0
入れ子のStackLayout
のセルビューを使用していますが、テキストが長い場合はラップされるラベルが1つあり、これが目的の動作です。しかし、ラップはLayoutOptions
を(基本的に)すべての親ビューに分割し、右側にグレーの隙間を生じさせます。TextWrappedラベル区切りレイアウトオプションStackLayoutのFillAndExpand
<StackLayout Orientation="Horizontal" BackgroundColor="Gray" Margin="0,30,0,0">
<BoxView
HorizontalOptions="Start"
BackgroundColor="#EEBB00"
WidthRequest="100"
/>
<StackLayout
BackgroundColor="#CC4400"
HorizontalOptions="FillAndExpand"
>
<BoxView
BackgroundColor="Green"
HeightRequest="10"
HorizontalOptions="FillAndExpand"
/>
<Label
FontSize="16"
HorizontalOptions="FillAndExpand"
Text="Name that is toolongandwillbewrapped"
/>
<StackLayout
Orientation="Horizontal"
HorizontalOptions="FillAndExpand"
BackgroundColor="Blue"
>
<Label
FontSize="13"
Text="Left"
TextColor="White"
HorizontalOptions="StartAndExpand"
VerticalTextAlignment="End"
/>
<Label
FontSize="13"
Text="Right"
TextColor="White"
HorizontalOptions="EndAndExpand"
VerticalTextAlignment="End"
/>
</StackLayout>
</StackLayout>
</StackLayout>
結果の見解は以下のとおりです。
なぜこれが起こっているので、私が言うことができますが、まあ、もちろん私はそれを好きではありません。予想される動作は、右側のスタックレイアウトが右端まで展開されることです。私はこれを回避するために様々な方法を試みましたが、成功した場合はここにはいません。誰かがアイデアを持っていますか?