Unwanted Margin at top of MasterDetailPage when nested in a NavigationPage

RyanDixonRyanDixon USMember ✭✭✭
edited September 2016 in Xamarin.Forms

Hey everyone,

Recently I have come across the following bug for Android when trying to use a MasterDetailPage on a new application.
It seems that when you nest a MasterDetailPage inside of a NavigationPage, you are left with a margin (about 10-20px in size) between the top of the NavigationPage and the DetailPage.

Note: The following works fine when compiled for UWP

MainPage = new NavigationPage(new MasterDetailPage() { Master = new ContentPage() { Title = "Hello Bug" }, Detail = new ContentPage() { BackgroundColor = Color.Aqua, Padding = 0 }, Padding = 0 }) { BackgroundColor = Color.Maroon, Padding = 0 };

It works correctly when you use any other type of page.

MainPage = new NavigationPage(new ContentPage() { BackgroundColor = Color.Aqua });

Has anyone else ever come across this in their project and potentially found a solution?

Thanks,
Ryan

Device: Nexus 7
Xamarin Forms Version: 2.3.2.127

Answers

  • Hi RyanDixon, have you solve this problem? cu'z i'm stuck on the same issue. Thanks

  • RyanDixonRyanDixon USMember ✭✭✭
    edited September 2016

    @NathielPaulino said:
    Hi RyanDixon, have you solve this problem? cu'z i'm stuck on the same issue. Thanks

    I filed a bug to try and get some feedback from the Xamarin Team
    https://bugzilla.xamarin.com/show_bug.cgi?id=44476

    I presume since in earlier versions of Forms, all padding/margin should be 0 by default so this behaviour should not be the case.

    In terms of a work around, theres not much you can do I don't think as the MDP will always be in focus :( (but of course correct me if I am wrong)

Sign In or Register to comment.