我正在使用\nXamarin.Froms:5.0.0.24125\nXcode 版本:13.0 (13A233)\nVisual Studio for Mac 社区版本 8.10.9(构建 3)\nNuGet 版本:5.9.0.7134\nXamarin.iOS 版本:14.20。 0.27(Visual Studio 社区)
\n主页.xaml:
\n<?xml version="1.0" encoding="utf-8" ?>\n<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"\n xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"\n x:Class="ListViewTopSpace.MainPage"\n xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"\n Title="Page title"\n ios:Page.UseSafeArea="true">\n <ListView ItemsSource="{Binding Users}"\n BackgroundColor="Blue"\n HasUnevenRows="True">\n <ListView.ItemTemplate>\n <DataTemplate>\n <ViewCell>\n <StackLayout Margin="0,0,0,0.5"\n Padding="10,0"\n BackgroundColor="AliceBlue">\n <Label FontSize="12">\n <Label.FormattedText>\n <FormattedString>\n <Span Text="User Id: "\n FontAttributes="Bold"/>\n <Span Text="{Binding Id, Mode=OneWay}"/>\n </FormattedString>\n </Label.FormattedText>\n </Label>\n <Label FontSize="12">\n <Label.FormattedText>\n <FormattedString>\n <Span Text="User name: "\n FontAttributes="Bold"/>\n <Span Text="{Binding Name, Mode=OneWay}"/>\n </FormattedString>\n </Label.FormattedText>\n </Label>\n </StackLayout>\n </ViewCell>\n </DataTemplate>\n </ListView.ItemTemplate>\n </ListView>\n</ContentPage>\nRun Code Online (Sandbox Code Playgroud)\nMainPageViewModel.cs
\n …