【发布时间】:2017-05-19 08:29:43
【问题描述】:
在我的 Xamarin Forms 应用程序中,我试图在我的移动界面上放置两个标签,一个在左下角,一个在右下角。
这是我目前的尝试。它是一排两列的网格布局,每个单元格都有一个标签,左边是HorizontalTextAlightment="Start",右边是HorizontalTextAlightment="End"
...other unrelated controls...
<StackLayout Orientation="Horizontal" Spacing="0" Padding="15" VerticalOptions="End" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Text="{Binding DeviceId}" HorizontalTextAlignment="Start" Grid.Row="0" Grid.Column="0" />
<Label Text="{Binding Version}" HorizontalTextAlignment="End" Grid.Row="0" Grid.Column="1" />
</Grid>
</StackLayout>
</StackLayout>
这会产生这种不需要的结果:(v1.0-1 应该向右对齐)
这就是我想要的:
【问题讨论】:
-
尝试使用 HorizontalOptions 作为 StartAndExpand 作为第一个标签和 EndAndExpand 作为第二个标签,而不是 HorizontalTextAlignment
标签: c# xaml xamarin xamarin.forms