Skip to content

StackLayout can be expand more than screen now #24515

Answered by stephenquan
albilaga asked this question in Ideas
Discussion options

You must be logged in to vote

You can use MultiMathExpressionConverter from CommunityToolkit.Maui to solve your problem:

<HorizontalStackLayout x:Name="horizontalStackLayout">
    <Label
        LineBreakMode="TailTruncation"
        MaxLines="2"
        MaximumWidthRequest="{MultiBinding {Binding Width, Source={Reference horizontalStackLayout}},
                                           {Binding Width, Source={Reference button}},
                                           Converter={StaticResource MultiMathExpressionConverter},
                                           ConverterParameter='x-x1'}"
        Text="{Binding Text}"
        VerticalTextAlignment="Center" />
    <Button x:Name="button" Text="Edit" />
</Hor…

Replies: 8 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@albilaga
Comment options

Answer selected by albilaga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
t/bug Something isn't working area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/android 🤖 platform/iOS 🍎 s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed s/needs-attention Issue has more information and needs another look migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert layout-stack
5 participants
Converted from issue

This discussion was converted from issue #23448 on August 29, 2024 16:34.