1

Im new to NS and I have a project. I want a Button floating inside a ScrollView.

<ScrollView>
     <StackLayout orientation="vertical">
           <AbsoluteLayout >
               <Button top="0" left="0" right="0" text="Test" style="font-size: 10; margin:5; " />
            </AbsoluteLayout>
                <Label text="Trending Now: " cssClass="trending-label" />
                <Repeater items="{{ categories }}">
                    <Repeater.itemTemplate>
                        .
                        .
                        .
                    </Repeater.itemTemplate>
                </Repeater>
            </StackLayout>
        </ScrollView>

But its not working. The Button is also scrolling. I want the Button to be floating on ScrollView. Thank you.

1 Answers1

0

The reason why the button is scrolling together with the other items is that everything is situated in a ScrollView. In order to have only the Label and the Repeater scrolling, the Button should be placed outside of it.

Another thing I have noticed is that on the Button, simultaneously are applied left and right alignment, which might cause a problem.

I made a possible implementation of the float button, which you can check here.

Neli Chakarova
  • 660
  • 1
  • 5
  • 18