0
votes

I'm using a MasterDetail page and the content pages reacheable from the Master are quite long. I'm trying the app on Android devices, and if I access one of those pages creating a new NavigationPage they show up correctly, but if I push them into the navigation stack, or if I go back to them from another page into the stack, the scroll doesn't work anymore.

This is the code for the creation of NavigationPage:

void OnItemSelected(object sender, SelectedItemChangedEventArgs e) {
    var item = e.SelectedItem as IMenuItem;
    if (item != null && item.SubmitPageType != null) {
        Detail = new NavigationPage((Page)Activator.CreateInstance(item.SubmitPageType));
        masterPage.ListView.SelectedItem = null;
        IsPresented = false;
    }
}

and this is the code that I use to push the same page into the navigation stack

this.Navigation.PushAsync(new MyPage());

In Xaml, I've tried using ScrollView into the ContentPage.Content element, but it doesn' work and it cuts out part of my layout at the bottom of the page.

Has anyone experienced similar problems with NavigationPage and content scrolling? Can anyone help me?

Thanks

1
it shouldn't matter how you navigate to the page, the scrolling will be determined by the content of the page itself. - Jason
I agree, that's why I cant figure out why if I access the page directly from the MasterPage, creating a new NavigationPage, the scroll works, but if I access that same page using PushAsync method it doesn't work. The page and the content are the same in both cases. - Stefania.87

1 Answers

0
votes

When I face simillar problem, this code in custom NavigationPageRenderer helps me

[assembly: ExportRenderer(typeof(YOUR_CUSTOM_NAV_PAGE), typeof(NoAnimationNavigationPageRenderer))]
namespace CanPay.Mobile.Droid.Renderers
{
   public class NoAnimationNavigationPageRenderer : NavigationPageRenderer
   {
       protected override void SetupPageTransition(FragmentTransaction transaction, bool isPush)
       {
           transaction.SetCustomAnimations(0, 0, 0, 0);
       }
   }
}