Maui for android scrollview issue

Haviv Elbsz 2,151 Reputation points
2023-09-04T11:49:14.04+00:00

Hello all. I have a scrollview that works ok. Now I want to add a row of 3 buttons at the top that should not be scrolled when the scrollview scrolling. Is that possible. Thank you very much.

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Answer accepted by question author
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,166 Reputation points Microsoft External Staff
    2023-09-05T02:51:05.25+00:00

    Hello,

    For this requirement, you could use a Grid to isolate the buttons from the ScrollView.

    Please refer to the key snippets below:

    <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <HorizontalStackLayout Grid.Row="0">
                <Button Text="btn1"/>
                <Button Text="btn2"/>
                <Button Text="btn3"/>
            </HorizontalStackLayout>
            <ScrollView Grid.Row="1">
            </ScrollView>
    </Grid>
    
    

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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