Android 调整StackLayout元素的高度
我对Xamarin表单非常陌生,我刚刚接到任务,为这个应用程序的Android版本调整UI。在安卓手机上,用户界面看起来不错,但在平板电脑上却有点小。因此,当设备是平板电脑时,我开发了一个新页面,但我似乎无法调整StackLayout元素的高度。代码如下:Android 调整StackLayout元素的高度,android,xamarin,cross-platform,Android,Xamarin,Cross Platform,我对Xamarin表单非常陌生,我刚刚接到任务,为这个应用程序的Android版本调整UI。在安卓手机上,用户界面看起来不错,但在平板电脑上却有点小。因此,当设备是平板电脑时,我开发了一个新页面,但我似乎无法调整StackLayout元素的高度。代码如下: <ListView.ItemTemplate> <DataTemplate> <ViewCell> <StackLayout VerticalOptions="Fill" Sp
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout VerticalOptions="Fill" Spacing="0" Padding="0" Margin="0">
<StackLayout VerticalOptions="Fill" HeightRequest="60" Padding="2" Orientation="Horizontal">
<Label VerticalOptions="Center" FontSize="19" Margin="14,0,0,0" Text="{Binding Name}" TextColor="White" ></Label>
<Image VerticalOptions="Center" HorizontalOptions="EndAndExpand" HeightRequest="50" WidthRequest="30" Source="imgArrow.png"></Image>
</StackLayout>
<BoxView Margin="0,2,0,0" HeightRequest="0.5" BackgroundColor="White" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
不管我在HeightRequest字段中输入了什么值,它看起来总是一样的。我肯定我错过了一些基本的东西。下面是它在屏幕上的样子。我只是想让它占用更多的空间,这将涉及到增加字体大小,但当我这样做时,它只是看起来很糟糕。我非常感激能得到的任何帮助。谢谢 是否尝试将listview的“hasRows”属性设置为true
我想它会解决你的字体大小问题