Maui for android scrollview issue

Haviv Elbsz 2,071 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.

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

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 43,051 Reputation points Microsoft Vendor
    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 Answers by the question author, which helps users to know the answer solved the author's problem.