1
我的ListView
都在子项前后添加了大量的填充项。项目前后的ListView填充项目
比如我已在我的主
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModel="clr-namespace:ViewModel;assembly=App"
x:Class="Pages.Master"
Title="Menu">
<ContentPage.BindingContext>
<viewModel:MasterViewModel />
</ContentPage.BindingContext>
<ListView ItemsSource="{Binding Pages}"
ItemSelected="ListView_OnItemSelected"
BackgroundColor="Red">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label Text="S" BackgroundColor="White" />
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
以下ListView
它呈现如下:
而且只要你滚动只是一点点,它会显示第一个元素(即顶部红色空间等于高度)
同样,您可以继续滚动,直到最后一项完全消失(即底部的红色空间等于高度)
我不改变任何代码中的视图的属性/样式 - 这一切都在XAML中完成,那么为什么在这之前有这么大的空间,后?