Which correct relation between MasterDetailPage, TabbedPage and NavigationPage on Xamarin.iOS?

FernandoVMFernandoVM BRMember ✭✭
edited January 2018 in Xamarin.Forms

Dear,

I have a MasterDetailPage as root page of my Xamarin Forms app, then I do:

  • In my App.xaml.cs:
    MainPage = new MyMasterPage(); //Here is my MasterDetailPage

  • In my MyMasterPage.xaml.cs:
    Master = new MyMenuPage>(); //Here is a ContentPage
    Detail = new NavigationPage(new MyHomePage()); //Here, MyHomePage is a TabbedPage

  • In my MyHomePage.xaml.cs:
    Children.Add(new MyTabPage1()); //Here, MyTabPage1 is a ContentPage
    Children.Add(new MyTabPage2()); //Here, MyTabPage2 is a ContentPage

Then, in Android all this works like a charm, but in Xamarin.iOS it does not.

Which correct relation between MasterDetailPage, TabbedPage and NavigationPage to work correctly on Xamarin.iOS?

Best Answers

  • FernandoVMFernandoVM BR ✭✭
    Accepted Answer

    Hi @Dhillu, again, thank you so much by reply!

    Let's go to the next round.. :)

    # "Ghost area" on the right side: Yes, I have removed GroupShortNameBinding binding and it was gone. I did not know this detail, thank you!

    # ToolbarItems: I revisited the properties Order, Priority and Name/Text and solved the problem.

    # Taps/Clicks: I think I found the problem, it seems to me is a xamarin forms ios problem, I will fill a bug in bugzilla. After a change that I do in the first execution of OnAppearing of a ContentPage the clicks does not works. The change is:

    • I create a new StackLayout (S1) and set it to Content property of the ContentPage. Inside the S1 I create two StackLayout (S2 e S3). Inside S2 I put the old content (S0) of ContentPage and in S3 I put another View.

    If I create the content page without do the change, all works fine. If I create the same content page but doing the change, all clicks stops works.

  • FernandoVMFernandoVM BR ✭✭
    Accepted Answer

Answers

  • DhilluDhillu INMember ✭✭✭

    Should work good in iOS too. What is the issue you're facing in iOS ?
    For navigation from your HomePage use MasterDetail's Detail page navigation.

    (App.Current.MainPage as MasterDetailPage).Detail.Navigation.PushModalAsync( new YOUR_PAGE());

  • FernandoVMFernandoVM BRMember ✭✭

    Hi @Dhillu, thank you by reply!

    In really, I'm starting the tests with this app in iOS and I'm with many issues, I think that some they are by Master Detail/Tabbed/Navigation concerns, but maybe not all, of course. Important detail: I not have a physical device still, then all my tests are using the remote simulator. Then, some of my issues are:

    • In bellow page (the MasterDetail's Master page - MyMenuPage), we see a "ghost area" on the right side that repeat the headers of my listview menu. I don't find the reason of that.

    • In bellow page (the MasterDetail's Detail page - MyHomePage[MyTabPage1, MyTabPage2, ...]):
      1. The ToolbarItem are abnormal, some are little, some are hidden.
      2. My clicks does not works. I can't click on button 'Start', I can't click on ListBox, I can't click on views with TapGestureRecognizer.

    Besides these, I have many other click problems. There are so many problems that I think is some basic detail, maybe about masterdetail / tabbed / navigation.

  • FernandoVMFernandoVM BRMember ✭✭
    Accepted Answer

    Hi @Dhillu, again, thank you so much by reply!

    Let's go to the next round.. :)

    # "Ghost area" on the right side: Yes, I have removed GroupShortNameBinding binding and it was gone. I did not know this detail, thank you!

    # ToolbarItems: I revisited the properties Order, Priority and Name/Text and solved the problem.

    # Taps/Clicks: I think I found the problem, it seems to me is a xamarin forms ios problem, I will fill a bug in bugzilla. After a change that I do in the first execution of OnAppearing of a ContentPage the clicks does not works. The change is:

    • I create a new StackLayout (S1) and set it to Content property of the ContentPage. Inside the S1 I create two StackLayout (S2 e S3). Inside S2 I put the old content (S0) of ContentPage and in S3 I put another View.

    If I create the content page without do the change, all works fine. If I create the same content page but doing the change, all clicks stops works.

  • FernandoVMFernandoVM BRMember ✭✭
    Accepted Answer
Sign In or Register to comment.