How to make a StackLayout Scrollable?

Posted by at 01-12-2017 18:26:10 in Article

You can make your view scrollable by using Scrollview.
Sample code below.
<ContentPage xmlns=""              xmlns:x=""              xmlns:local="clr-namespace:WaterBookingApp"              x:Class="WaterBookingApp.Views.Main">
    <ContentPage.ToolbarItems >         <ToolbarItem Name="MenuItem1" Order="Primary" Icon="Microsoft.png" Text="Login" Priority="0" />     </ContentPage.ToolbarItems>     <ScrollView>      <StackLayout>         <StackLayout>             <StackLayout VerticalOptions="FillAndExpand">                 <Label Text="Welcome to Company!" FontSize="Large" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" Margin="0,60,0,0"/>                 <Image x:Name="LoginIcon" Source="LoginLogo.png" Margin="0,80,0,0" />             </StackLayout>             <StackLayout>
                <StackLayout.Padding>                     <OnIdiom x:TypeArguments="Thickness">                         <OnIdiom.Phone>40,0,40,0</OnIdiom.Phone>                         <OnIdiom.Tablet>140,150,140,0</OnIdiom.Tablet>                     </OnIdiom>
                </StackLayout.Padding>                 <BoxView HeightRequest="1" Margin="0,10,0,10"  WidthRequest="1" Color="White" />                 <Label Text="Book Now" />                 <BoxView HeightRequest="1" Margin="0,10,0,10"  WidthRequest="1" Color="White" />                 <Label x:Name="LbNavigationBarl_NumberofCans" Text="Number of Cans" />                 <Picker x:Name="numberpicker" Title="Number of Cans" />
                <Label x:Name="Lbl_Address" Text="Delivery Address" />                 <Entry x:Name="Entry_Address" Text="Your Address here" />                 <Button x:Name="Btn_Book" Text="Proceed" Clicked="Btn_Book_Clicked" />             </StackLayout>         </StackLayout>     </StackLayout>     </ScrollView> </ContentPage>

Tags: Scrollview; StackLayout Scrollable; Xamarin Forms

Login to comment.

Recent Comments at 18-02-2018 21:34:37

[google flights](

Login to Reply. at 18-02-2018 21:34:25

[url=]google flights[/url]

Login to Reply. at 18-02-2018 21:34:08

Login to Reply. at 18-02-2018 21:33:57

Feb 6, 2018 - I guess it's not so much a question as a 'hmm, that's weird'...I usually go straight to an airline's site to book but thought I'd check out Google Flights. I put in my search for MOB-CDG and the dates (9/20-9/26) and Google Flights presented me with a great price of $508 roundtrip out with United and back with ... <a href="">google flights</a>

Login to Reply.