Hello,
After testing, this should be due to layout height distribution issues.
You could include this code in a VerticalStackLayout
.
<StackLayout
Margin="5,0"
HorizontalOptions="StartAndExpand"
VerticalOptions="StartAndExpand"
IsVisible="{Binding LockedVisibility}"
Orientation="Horizontal">
<Label
Text="{Binding lockedLocation.locakedStatusText, Converter={StaticResource specialCharactorConverter}}"
</Label>
<Image
Style="{StaticResource RequestHeaderImageStyle}"
Source="ic_green_tick_xx.png">
</Image>
</StackLayout>
<StackLayout
Orientation="Horizontal"
HorizontalOptions="FillAndExpand">
<Label
Text="{Binding invoice.Amount, StringFormat='${0:F0}'}"
</Label>
<Label
Text="{Binding invoice.dueDate, StringFormat='Due date: {0:F0}',
</Label>
</StackLayout>
As a side note, StackLayout in MAUI does not use layout properties with the same orientation.
A StackLayout only respects the
Start
,Center
,End
, andFill
LayoutOptions
fields on child views that are in the opposite direction to the StackLayout orientation. Therefore, child views within a vertically oriented StackLayout can set theirHorizontalOptions
properties to one of theStart
,Center
,End
, orFill
fields. Similarly, child views within a horizontally oriented StackLayout can set theirVerticalOptions
properties to one of theStart
,Center
,End
, orFill
fields. A StackLayout does not respect theStart
,Center
,End
, andFill
LayoutOptions
fields on child views that are in the same direction as the StackLayout orientation. Therefore, a vertically oriented StackLayout ignores theStart
,Center
,End
, orFill
fields if they are set on theVerticalOptions
properties of child views. Similarly, a horizontally oriented StackLayout ignores theStart
,Center
,End
, orFill
fields if they are set on theHorizontalOptions
properties of child views.
You could refer to Align and position .NET MAUI controls for more detailed information.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.