I have a grid with Frame elements as cells. Within some frame elements, there's label elements. The problem is the label stretches only as much as its content.
My goal is to make labels take the entire space of its parent elements(Frames). I tried setting the VerticalOptions and HorizontalOptions properties to "StartAndExpand" and also "FillAndExpand" to no avail
<Grid>
<Frame Grid.Row="0" Grid.Column="0">
<Label Text="Hello" />
</Frame>
...
</Grid>
Thank you!
EDIT: To clarify, I want to stretch label itself but not its text.
CodePudding user response:
As Frame
has a default padding
, simply set it manually like below.
<Frame padding="0">
<....>
</Frame>
Plus, sometimes label with long text not behave correctly inside the Frame
,
and one workaround is to wrap the Label with a StackLayout
.