我有这个XAML:
<Grid Grid.Column="2" >
<Grid.RowDefinitions>
<RowDefinition Height="50*" />
<RowDefinition Height="50*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" VerticalOptions="End" VerticalTextAlignment="End" Text="ABC" />
<Label Grid.Row="1" VerticalOptions="Start" VerticalTextAlignment="Start" Text="DEF" />
</Grid>
有人可以向我解释VerticalOptions
和之间的区别VerticalTextAlignment
吗?
LayoutOptions
(VerticalOptions)决定Label
放置在View
TextAlignment
(VerticalTextAlignment)决定文本在Label
控件中的放置位置以下示例将Label
放在View
文本的垂直开始处,并将文本放在Label
控件的末尾:
<Label
BackgroundColor="Green"
HeightRequest="400"
VerticalOptions="Start"
VerticalTextAlignment="End"
Text="Hello Xamarin">
</Label>
如果我们更改值,Label
则将放置在您的垂直端View
,但文本位于的开头Label
:
<Label
BackgroundColor="Green"
HeightRequest="400"
VerticalOptions="End"
VerticalTextAlignment="Start"
Text="Hello Xamarin">
</Label>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句