【发布时间】:2019-11-13 20:23:18
【问题描述】:
【问题讨论】:
-
这是一个数据网格。有多种开源和商业选项可供选择
标签: visual-studio xaml xamarin.forms
【问题讨论】:
标签: visual-studio xaml xamarin.forms
如果你想要一种快速/专业的方式,你可以试试 Synfucion DataGrid
你也可以使用Grid来达到效果。
例如:
<StackLayout >
<Grid BackgroundColor="Black" HorizontalOptions="StartAndExpand" VerticalOptions="StartAndExpand" RowSpacing="1" ColumnSpacing="1" >
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Grid.Row="0" Text="Name" BackgroundColor="LightGreen" TextColor="Black" FontAttributes="Bold" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
<Label Grid.Column="1" Grid.Row="0" Text="My name" BackgroundColor="White" TextColor="Black" FontAttributes="Bold" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
<Label Grid.Column="2" Grid.Row="0" Text="City" BackgroundColor="LightGreen" TextColor="Black" FontAttributes="Bold" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
<Label Grid.Column="3" Grid.Row="0" Text="MyCity" BackgroundColor="White" TextColor="Black" FontAttributes="Bold" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
<Label Grid.Column="0" Grid.Row="1" Text="Address " BackgroundColor="LightGreen" TextColor="Black" FontAttributes="Bold" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
<Label Grid.Column="1" Grid.Row="1" Text="My Address1234" BackgroundColor="White" TextColor="Black" FontAttributes="Bold" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
<Label Grid.Column="2" Grid.Row="1" Text="Country" BackgroundColor="LightGreen" TextColor="Black" FontAttributes="Bold" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
<Label Grid.Column="3" Grid.Row="1" Text="MyCountry" BackgroundColor="White" TextColor="Black" FontAttributes="Bold" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
</Grid>
</StackLayout>
【讨论】: