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中完成,那麼爲什麼在這之前有這麼大的空間,後?