下面的代码在Android中运行良好,但在iOS中却无法正常运行。问题是,高度似乎是此解决方案的替代方案。提前感谢。
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<Grid BackgroundColor="White" ColumnSpacing="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Text="{Binding Key.OperationId}" IsVisible="false"/>
<Image Source="{Binding Key.ImageUrl}" Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" WidthRequest="50" HeightRequest="50" VerticalOptions="StartAndExpand" HorizontalOptions="StartAndExpand" />
<Label Text="{Binding Key.Description}" Grid.Row="0" Grid.Column="1" FontAttributes="Bold" TextColor="Black"
VerticalOptions="StartAndExpand" HorizontalOptions="StartAndExpand" FontSize="15" />
<Label Text="{Binding Key.Code}" Grid.Row="1" Grid.Column="1" TextColor="Black" VerticalOptions="StartAndExpand" HorizontalOptions="StartAndExpand" FontSize="15" />
</Grid>
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
1条答案
按热度按时间bjg7j2ky1#
正在此线程上跟踪此潜在问题:https://github.com/xamarin/Xamarin.Forms/issues/3769
评论中有一个要点建议创建一个
custom renderer
来修复iOS中ListView GroupHeader的大小:https://gist.github.com/nbevans/a713dc9c77a8f530b6f4f3cd4fad83c2Reference link中的一个。