Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Visual Design of MasterDetailPage

$
0
0

I'm noticing that on iOS the MasterDetailPage looks different than I'd expect on small form factor. It appears that the page I've set to be the Detail hangs over a bit on the right hand side of the screen. Has it always been like this? (see attached screenshot)

Is there a way to change this behavior? On small form factor, I'd like the master and detail pages to take up the entire view when navigated to.

Here's the code I have to set up the MainPage of the app:

public class MainPage : MasterDetailPage
{
    public MainPage()
    {
        Master = new NavigationPage(new ProjectList()) { Title = "Projects" };
        Detail = new NavigationPage(new ProjectDetails()) { };
        // Choose how to display the split view based on the device form factor
        if (Device.Idiom == TargetIdiom.Tablet)
        {
            MasterBehavior = MasterBehavior.Split;   // always show master/detail view on Tablets
        }
        else if (Device.Idiom == TargetIdiom.Phone)
        {
            MasterBehavior = MasterBehavior.SplitOnLandscape;  // show master/detail view on Phones in landscape orientation only
        }
        // Show Master Pane by default (Project List page)
        IsPresented = true; 
    }
}

I've tried removing the "else if" case, where I set the MasterBehavior from small form factor (phone), but the visual appearance is the same.


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>