在我的Xamarin Forms應用程序中,我試圖在移動界面上放置兩個標籤,一個放在左下角,一個放在右下角。Xamarin佈局如何在屏幕的左下角和右下角放置標籤
這是我目前的嘗試。這是一個網格佈局與一排兩列,在每個單元的標籤,左某與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 – Mounika