【发布时间】:2019-02-08 11:10:19
【问题描述】:
我正在尝试在 stacklayout 中放置一个标签...行数可能会根据数据而变化...但是当文本更多时标签会消失,它不会扩展...
<StackLayout Orientation="Vertical"
BackgroundColor="White"
VerticalOptions="FillAndExpand"
Spacing="0">
<StackLayout Orientation="Vertical" BackgroundColor="Silver"
HeightRequest="45">
<AbsoluteLayout BackgroundColor="White"
HorizontalOptions="FillAndExpand"
HeightRequest="44"
Margin="0.5"
VerticalOptions="StartAndExpand"
>
<Label Text="Objective"
Margin="15,0,0,0"
AbsoluteLayout.LayoutBounds="0,0.5,-1,-1"
AbsoluteLayout.LayoutFlags="PositionProportional"
VerticalTextAlignment="Center"
FontFamily="Roboto#300" FontSize="16" FontAttributes="None" TextColor="#FF888888" />
<Button HeightRequest="32" Margin="0,0,15,0"
WidthRequest="32"
Padding="0"
x:Name="ObjectiveButton"
Clicked="Objective_Button_Handle_Clicked"
BackgroundColor="Transparent"
AbsoluteLayout.LayoutBounds="1,0.5,-1,-1"
AbsoluteLayout.LayoutFlags="PositionProportional"
Image="collapseIcon.png"/>
</AbsoluteLayout>
</StackLayout>
<StackLayout Orientation="Vertical"
BackgroundColor="White"
x:Name="ObjectiveStackLayout"
VerticalOptions="CenterAndExpand"
IsVisible="true" >
<Label Text="Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
Ut enim ad minim veniam,
quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea
commodo consequat."
FontFamily="Roboto#400"
FontSize="14"
VerticalTextAlignment="Center"
Margin="15,10,0,0"
MaxLines="0"
LineBreakMode="WordWrap"
FontAttributes="None"
TextColor="#FF858585" />
</StackLayout>
</StackLayout>
【问题讨论】:
标签: xaml xamarin.forms