为什么我要使用FlowListView,底部会有这么多的空白。 请查看我上传的图片。 帮帮我,谢谢
有我的代码:
<Grid BackgroundColor="{StaticResource ColorEFEFEF}">
<ScrollView>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<StackLayout Grid.Row="0" BackgroundColor="White" Padding="17,6">
<flv:FlowListView Grid.Row="0" FlowColumnCount="3"
SeparatorVisibility="None"
HasUnevenRows="True"
FlowItemsSource="{Binding Albums}">
<flv:FlowListView.FlowColumnTemplate>
<DataTemplate>
<templates:AllAlbumsTempalte></templates:AllAlbumsTempalte>
</DataTemplate>
</flv:FlowListView.FlowColumnTemplate>
</flv:FlowListView>
</StackLayout>
<StackLayout Grid.Row="1" Style="{StaticResource GridStyleSection}">
<Label FontSize="Small">
<Label.FormattedText>
<FormattedString>
<Span Text="当照片数量少于4张时,"></Span>
<Span Text="不会被搜索到" TextColor="Red"></Span>
<Span Text="。另外照片数量越多,"></Span>
<Span Text="搜索权重越高" TextColor="Red"></Span>
<Span Text="。"></Span>
</FormattedString>
</Label.FormattedText>
</Label>
</StackLayout>
<!--上传照片-->
<StackLayout Grid.Row="2" Style="{StaticResource GridStyleSection}">
<StackLayout Orientation="Vertical" HorizontalOptions="Start">
<Label Text="上传图片" FontSize="Medium"></Label>
<Button x:Name="ButtonPhoto" Text="+"
BorderWidth="1"
BorderColor="LightGray"
HeightRequest="115"
WidthRequest="115"
BackgroundColor="{StaticResource ColorFAFAFA}"
FontSize="60"
FontAttributes="None"
CornerRadius="3"
TextColor="{StaticResource ColorDFDFDF}"/>
</StackLayout>
</StackLayout>
</Grid>
</ScrollView>
</Grid>
显示后,底部还有很多空白。
点击下面的链接查看图片,谢谢: https://i.stack.imgur.com/JqSrC.png
templates:AllAlbumsTempalte代码在这里:
<?xml version="1.0" encoding="utf-8" ?>
<Grid xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:ffimgtransform="clr-namespace:FFImageLoading.Transformations;assembly=FFImageLoading.Transformations"
x:Class="Ransol.Springlove.App.Templates.AlbumTemplate"
Padding="3,3,3,3">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Frame Padding="0" CornerRadius="3" HasShadow="True" BorderColor="Transparent" HeightRequest="115">
<ffimageloading:CachedImage DownsampleToViewSize="true"
AbsoluteLayout.LayoutFlags="All"
IsOpaque="False"
Source="{Binding SmallUrl}"
HeightRequest="115"
DownsampleHeight="115"
MinimumHeightRequest="115"
DownsampleUseDipUnits="False"
Aspect="AspectFill">
</ffimageloading:CachedImage>
</Frame>
<Frame Padding="0" BackgroundColor="Transparent" CornerRadius="3">
<StackLayout HorizontalOptions="End" VerticalOptions="Start" Padding="6,3" BackgroundColor="Silver" Opacity="0.6">
<Label Text="" HorizontalTextAlignment="Center" TextColor="White" FontSize="Medium">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" Android="fa-solid-900.ttf#Font Awesome 5 Free" iOS="Font Awesome 5 Free" />
</Label.FontFamily>
</Label>
</StackLayout>
</Frame>
<Frame Padding="0" BackgroundColor="Transparent" CornerRadius="3">
<StackLayout x:Name="Delete" HorizontalOptions="End" VerticalOptions="Start" Padding="6,3">
<Label Text="" HorizontalTextAlignment="Center" TextColor="White" FontSize="Medium">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" Android="fa-solid-900.ttf#Font Awesome 5 Free" iOS="Font Awesome 5 Free" />
</Label.FontFamily>
</Label>
</StackLayout>
</Frame>
</Grid>