Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
611 views
in Technique[技术] by (71.8m points)

xaml - Why placeholders from entry and labels is not visible properly in Xamarin Forms?

My problem is that I'm developing an app via an emulator and everything is working good, but on my Android smartphone I have an issue, all placeholders and labels don't appear.

My code:

<ContentPage.Resources>
        <ResourceDictionary>
            <converters1:InverseBoolConverter x:Key="InverseBoolConverter"/>
            <converters1:FirstValidationErrorConverter x:Key="FirstValidationErrorConverter"/>
        </ResourceDictionary>
    </ContentPage.Resources>
    <ContentPage.Content>
        <ScrollView>
        <StackLayout Padding="30"
                         VerticalOptions="CenterAndExpand">

            <Label Text="Logare"
                      Style="{StaticResource TitleStyle}"/>
            <Image Source="ic_login.png" WidthRequest="100" HeightRequest="100"/>
                <!--IDNP-->
            <Entry Text="{Binding IDNP.Value}" 
                       Placeholder="IDNP" HorizontalOptions="FillAndExpand">
                <Entry.Behaviors>
                    <behaviours:EntryLineValidationBehaviour IsValid="{Binding IDNP.IsValid}"/>
                </Entry.Behaviors>
            </Entry>

            <Label Text="{Binding IDNP.Errors, Converter={StaticResource FirstValidationErrorConverter}}"
                        IsVisible="{Binding IDNP.IsValid, Converter={StaticResource InverseBoolConverter}}"
                         Style="{StaticResource ErrorTextStyle}"/>


            <!--Password-->

            <Entry Text="{Binding Password.Value}"
                         Placeholder="Parola" IsPassword="True" HorizontalOptions="FillAndExpand">
                <Entry.Behaviors>
                    <behaviours:EntryLineValidationBehaviour IsValid="{Binding Password.IsValid}"/>
                </Entry.Behaviors>
            </Entry>

                <Label Text="{Binding Password.Errors, Converter={StaticResource FirstValidationErrorConverter}}"
                        IsVisible="{Binding Password.IsValid, Converter={StaticResource InverseBoolConverter}}"
                        Style="{StaticResource ErrorTextStyle}"/>


            <Button Text="LOGARE" x:Name="Button"
                        Command="{Binding LogInCommand}"/>
        </StackLayout>

            </ScrollView>
    </ContentPage.Content>
</ContentPage>

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...