XAML 占位符在Android上不可见

ui7jx7zq  于 11个月前  发布在  Android
关注(0)|答案(1)|浏览(102)

我有以下代码

<VerticalStackLayout Grid.Row="0" Margin="30,10,30,10">
                <Entry Text="{Binding DatoEmpresa.Empresa}" Placeholder="Empresa" Margin="30,5,30,0"/>
                <Entry Text="{Binding DatoEmpresa.PersonaContacto}" Placeholder="Persona de Contacto" Margin="30,5,30,0"/>
                <Entry Text="{Binding DatoEmpresa.Especialidad}" Placeholder="Especialidad" Margin="30,5,30,0"/>
                <Entry Text="{Binding DatoEmpresa.Telefono}" Placeholder="Teléfono" Margin="30,5,30,0" Keyboard="Telephone"/>
                <Entry Text="{Binding DatoEmpresa.Notas}" Placeholder="Observaciones" Margin="30,5,30,0"/>
                <Grid Margin="0,0,0,10"
                    ColumnDefinitions="*,*,*">
                    <ImageButton x:Name="btnSaveUpdate"
                            Grid.Column="0"
                            Margin="20"
                            Command="{Binding SaveDatosCommand}"
                            Source="save_file.png"
                            WidthRequest="20"
                            HeightRequest="20"/>
                    <ImageButton x:Name="btnDelete" 
                            Grid.Column="1"
                            Margin="20"
                            Command="{Binding DeleteDatosCommand}"
                            Source="delete.png"
                            WidthRequest="20"
                            HeightRequest="20"/>
                    <ImageButton x:Name="btnTrabajo" 
                            Grid.Column="2"
                            Margin="20"
                            Clicked="btnTrabajo_Clicked"
                            Source="mantenimiento.png"
                            WidthRequest="20"
                            HeightRequest="20"/>
                </Grid>
            </VerticalStackLayout>

字符串
在MacCatalyst和iOS中运行应用程序,条目的占位符是可见的,但在Android中运行应用程序,它们是不可见的。任何想法,我需要做什么,让他们显示?谢谢

1cosmwyk

1cosmwyk1#

此问题与Styles.xaml中EntryMinimumHeightRequestHeightRequest的值有关,将其更改为Phone=35可以解决此问题。

<Style TargetType="Entry">

     <!--Omitted for brevity>

      <Setter Property="MinimumHeightRequest" Value="{OnIdiom 40, Phone=35}"/>
      <Setter Property="HeightRequest" Value="{OnIdiom 40, Phone=35}"/>
  </Style>

字符串

相关问题