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

Is something broken with MasterDetailPage.IsPresented?

$
0
0

I want to build a screen with a MasterDetailPage, where the Master is viewable by default. I am testing using an iPad running iOS 7.1, but also have tried the iPad simulator running iOS 8.0. According to the documentation, setting IsPresented = true should cause the Master page to be displayed. However, it does not display, and will not unless it is swiped into view by a touch gesture. Am I missing something fundamental, or is there a bug in MasterDetailPage implementation. Here is my very basic code, at the root of a brand new Xamarin.Forms project:

`
public static Page GetMainPage ()
{
int[] numbers = { 1, 2, 3, 4, 5 };
var page = new MasterDetailPage () {

    Master = new ContentPage () {
        Content = new ListView () {

            ItemsSource = numbers
        },
    },
    Detail = new ContentPage { 
        Content = new Label {
            Text = "Hello, Forms!",
            VerticalOptions = LayoutOptions.CenterAndExpand,
            HorizontalOptions = LayoutOptions.CenterAndExpand,
        },
    },
        IsPresented = true          
};
page.Appearing += (sender, e) => {  
    page.IsPresented = true;
};

return page;
}

}
`


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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