我在无法将两个标签堆叠在StackLayout
中并且无法容纳内容的情况下遇到问题。
当前输出:
我尝试并设置了VerticalOptions
,Margin
和Padding
属性,但是它仍然包含边距(红色背景),并且第二个内容没有触及“天花板StackLayout
的父级。
当前代码:
<ViewCell>
<StackLayout Orientation="Horizontal" VerticalOptions="Start">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Source="summary.png"/>
</StackLayout>
<StackLayout Orientation="Vertical" VerticalOptions="Start" BackgroundColor="Red" Margin="0" Padding="0">
<StackLayout BindingContext="{Binding Date}" VerticalOptions="Start" BackgroundColor="Beige" Margin="0" Padding="0">
<Label Text="{Binding Text}" TextColor="{Binding Color}" VerticalOptions="Start"/>
</StackLayout>
<StackLayout BindingContext="{Binding Result}" VerticalOptions="Start" BackgroundColor="Blue" Margin="0" Padding="0">
<Label Text="{Binding Text}" TextColor="{Binding Color}" FontSize="{Binding FontSize}" VerticalOptions="Start"/>
</StackLayout>
</StackLayout>
</StackLayout>
</ViewCell>