will it auto wrap break line if there is too many in stacklayout?

mc 4,516 Reputation points
2023-04-30T02:57:01.9466667+00:00

I create a horizontalStackLayout and add some buttons

will it auto break line the button is too may?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,505 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 75,661 Reputation points Microsoft Vendor
    2023-05-01T03:02:46.07+00:00

    Hello,

    will it auto break line the button is too may?

    No, but you can use flexlayout to add some buttons, flexlayout will add auto break line.

    
            <FlexLayout
                  Wrap="Wrap"
                  JustifyContent="Start"  
                  FlowDirection="LeftToRight">
           
    add buttons here
    
            <Button
                HorizontalOptions="Start"
                VerticalOptions="Start"
                Text="Welcome to .NET MAUI!2"
                />
            <Button
                 HorizontalOptions="Start"
                VerticalOptions="Start"
                Text="2Welcome to .NET MAUI!"
                />
           
          
        </FlexLayout>
    
    

    Best Regards,

    Leon Lu


    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.