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

MasterDetail & Tabbed pages have unexpected results on Android

$
0
0

Hi! I just started out with the (awesome) Xamarin.Forms, but bumped into a problem yesterday that I can't seem to figure out.

I created a MasterDetail page that contains two Menu options: One that links to a TabbedPage, another to a ContentPage . When opening this on iOS, everything seems to be working fine. Yet, when running this sample in Android, some strange behaviour occurs.

When I open the Drawer (slide the page to the right), I expect the full Page to slide the right. On iOS, this is happening. Yet, on Android, the "Tabs" from the TabbedPage are still stuck on top. The ContentPage does seem to work fine; it's only the Tabs that are stuck in place.

This is the code (very simplified):

public class WrapperPage : MasterDetailPage
{
    public WrapperPage ()
    {
        var menuItems = new List<MenuItem> ()
        {
            new MenuItem() { Title = "Tabbed Page", Page = new Tabbed() },
            new MenuItem() { Title = "Content Page", Page = new Content() }
        };

        // Code that creates a ListView for the .Master and
        // binds to the ItemSelected to change the .Detail
    }
}

public class Tabbed : TabbedPage
{
    public Tabbed ()
    {
        this.Children.Add ( new TabOne() { Title = "One" } );
        this.Children.Add ( new TabTwo() { Title = "Two" } );
        // The Tabs are two simple ContentPages
    }
}

public class Content : ContentPage
{
    public Content ()
    {
        // Simple label for the ContentPage
    }
}

I don't think I'm doing something wrong here (especially since it does seem to work on iOS), or do I just have different expectation?

Attached:

  • ZIP archive with the project
  • Screenshot from iOS (tabs move to the right)
  • Screenshot from Android (tabs don't move to the right)

Viewing all articles
Browse latest Browse all 75885

Trending Articles