Scroll when entering

Hi. I need do that when enter fields I can scroll my page because i entering filed and can't select next field. How can I do it?

Answers

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    add your StackLayout to a ScrollView

  • slav4ik51493qslav4ik51493q RUMember ✭✭

    @AlessandroCaliaro said:
    add your StackLayout to a ScrollView

    but i done it.
    <StackLayout VerticalOptions="Start"> <StackLayout VerticalOptions="Start" Spacing="15" > <StackLayout.Padding> <Thickness Top="15" Left ="20" Right ="20" Bottom ="0" /> </StackLayout.Padding> <Image Source="logo.png" HorizontalOptions="Center" /> </StackLayout> <StackLayout BackgroundColor="#98B7D8"> <StackLayout.Padding> <Thickness Top="15" Bottom ="15" /> </StackLayout.Padding> <Label HorizontalOptions="Center" Text="Great News, Your are eligible. Few more details to register" TextColor="Black" FontSize="13"/> </StackLayout> <StackLayout Orientation="Horizontal" HorizontalOptions="End" IsVisible="False"> <StackLayout.Padding> <Thickness Right="15" /> </StackLayout.Padding> <Label TextColor="Black" Text="Login using" VerticalOptions="Center"/> <Image Source="fb.png"/> <Image Source="google.png"/> <Image Source="twitter.png"/> <Image Source="linkedin.png"/> </StackLayout> <ScrollView x:Name="MyScrollView"> <StackLayout VerticalOptions="Start" Spacing="15" Padding="15,0,30,20"> <Entry Placeholder="First Name" FontSize="18" Text="{Binding FirstName}" x:Name="Next"> <Entry.Behaviors> <behaviours:ScrollToOnFocusBehavior ScrollView="{x:Reference MyScrollView}" ScrollTo="{x:Reference Next1}" /> <behaviours:FocusOnReturnBehavior FocusOn="{x:Reference Next1}" /> </Entry.Behaviors> </Entry> <Entry Placeholder="Profile Name" FontSize="18" Text="{Binding ProfileName}" x:Name="Next1"> <Entry.Behaviors> <behaviours:ScrollToOnFocusBehavior ScrollView="{x:Reference MyScrollView}" ScrollTo="{x:Reference Next2}" /> <behaviours:FocusOnReturnBehavior FocusOn="{x:Reference Next2}" /> </Entry.Behaviors> </Entry> <Entry Placeholder="Email/Username" FontSize="18" Text="{Binding Email}" x:Name="Next2"> <Entry.Behaviors> <behaviours:EmailEntryBehaviour/> <behaviours:ScrollToOnFocusBehavior ScrollView="{x:Reference MyScrollView}" ScrollTo="{x:Reference Next3}" /> <behaviours:FocusOnReturnBehavior FocusOn="{x:Reference Next3}" /> </Entry.Behaviors> </Entry> <Entry Placeholder="Password" FontSize="18" IsPassword="True" Text="{Binding Password}" x:Name="Next3"> <Entry.Behaviors> <behaviours:PasswordEntryBehaviour/> <behaviours:ScrollToOnFocusBehavior ScrollView="{x:Reference MyScrollView}" ScrollTo="{x:Reference Next4}" /> <behaviours:FocusOnReturnBehavior FocusOn="{x:Reference Next4}" /> </Entry.Behaviors> </Entry> <Entry Placeholder="Confirm Password" FontSize="18" IsPassword="True" Text="{Binding PasswordConfirmation}" x:Name="Next4" /> <Button Text="Register Now" HorizontalOptions="Center" BackgroundColor="White" TextColor="Black" Command="{Binding RegisterCommand}"/> </StackLayout> </ScrollView> </StackLayout> </ContentPage>

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    Try to insert also the first stacklayout inside the scrollview

  • slav4ik51493qslav4ik51493q RUMember ✭✭
    edited January 2017

    @AlessandroCaliaro said:
    Try to insert also the first stacklayout inside the scrollview

    So? If yes then it not worked.
    <ScrollView x:Name="MyScrollView"> <StackLayout VerticalOptions="Start"> <StackLayout VerticalOptions="Start" Spacing="15" > <StackLayout.Padding> <Thickness Top="15" Left ="20" Right ="20" Bottom ="0" /> </StackLayout.Padding> <Image Source="logo.png" HorizontalOptions="Center" /> </StackLayout> <StackLayout BackgroundColor="#98B7D8"> <StackLayout.Padding> <Thickness Top="15" Bottom ="15" /> </StackLayout.Padding> <Label HorizontalOptions="Center" Text="Great News, Your are eligible. Few more details to register" TextColor="Black" FontSize="13"/> </StackLayout> <StackLayout Orientation="Horizontal" HorizontalOptions="End" IsVisible="False"> <StackLayout.Padding> <Thickness Right="15" /> </StackLayout.Padding> <Label TextColor="Black" Text="Login using" VerticalOptions="Center"/> <Image Source="fb.png"/> <Image Source="google.png"/> <Image Source="twitter.png"/> <Image Source="linkedin.png"/> </StackLayout> <StackLayout VerticalOptions="Start" Spacing="15" Padding="15,0,30,20"> <Entry Placeholder="First Name" FontSize="18" Text="{Binding FirstName}" x:Name="Next"> <Entry.Behaviors> <behaviours:ScrollToOnFocusBehavior ScrollView="{x:Reference MyScrollView}" ScrollTo="{x:Reference Next1}"/> <behaviours:FocusOnReturnBehavior FocusOn="{x:Reference Next1}" /> </Entry.Behaviors> </Entry> <Entry Placeholder="Profile Name" FontSize="18" Text="{Binding ProfileName}" x:Name="Next1"> <Entry.Behaviors> <behaviours:ScrollToOnFocusBehavior ScrollView="{x:Reference MyScrollView}" ScrollTo="{x:Reference Next2}"/> <behaviours:FocusOnReturnBehavior FocusOn="{x:Reference Next2}" /> </Entry.Behaviors> </Entry> <Entry Placeholder="Email/Username" FontSize="18" Text="{Binding Email}" x:Name="Next2"> <Entry.Behaviors> <behaviours:EmailEntryBehaviour/> <behaviours:ScrollToOnFocusBehavior ScrollView="{x:Reference MyScrollView}" ScrollTo="{x:Reference Next3}" /> <behaviours:FocusOnReturnBehavior FocusOn="{x:Reference Next3}" /> </Entry.Behaviors> </Entry> <Entry Placeholder="Password" FontSize="18" IsPassword="True" Text="{Binding Password}" x:Name="Next3"> <Entry.Behaviors> <behaviours:PasswordEntryBehaviour/> <behaviours:ScrollToOnFocusBehavior ScrollView="{x:Reference MyScrollView}" ScrollTo="{x:Reference Next4}" /> <behaviours:FocusOnReturnBehavior FocusOn="{x:Reference Next4}" /> </Entry.Behaviors> </Entry> <Entry Placeholder="Confirm Password" FontSize="18" IsPassword="True" Text="{Binding PasswordConfirmation}" x:Name="Next4" /> <Button Text="Register Now" HorizontalOptions="Center" BackgroundColor="White" TextColor="Black" Command="{Binding RegisterCommand}"/> </StackLayout> </StackLayout> </ScrollView>

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    I think to have understand your problem.
    You would like to scroll fields when the keyboard is visible... but I think it is not possible.

  • slav4ik51493qslav4ik51493q RUMember ✭✭

    Up

  • slav4ik51493qslav4ik51493q RUMember ✭✭

    Up

  • slav4ik51493qslav4ik51493q RUMember ✭✭

    @AlessandroCaliaro said:
    I think to have understand your problem.
    You would like to scroll fields when the keyboard is visible... but I think it is not possible.

    Maybe just scroll that visible next field.

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    There is not a scrollto method?
Sign In or Register to comment.