In Xamarin Forms, I need to write a custom TabbedPageRenderer to hide the Android tabbar. However, I don't know how to do this.
[assembly: ExportRenderer(typeof(CTabbedPage), typeof(CTabbedPageRenderer))]
namespace App15.Droid
{
    public class CTabbedPageRenderer : TabbedPageRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e)
        {
            base.OnElementChanged(e);
            if (e.NewElement != null)
            {
                (this.Context as Activity).ActionBar.NavigationMode = ActionBarNavigationMode.Standard;
            }
        }
    }
}
This code throws an exception because ActionBar is set to null. I'm using AppCompat 23.3.0 and XF 2.3.2.118-pre1.
EDIT: I'm thinking the reason ActionBar is null is Toolbar has replaced it, but I still don't know how to hide tabs. Also, I'm not interested in pushing pages modally. 
I also tried adding android:visibility="gone" to Tabbar.axml. This successfully hides the tabbar but the tabbar still occupies space.
This is a known bug in Xamarin: android:visibility="gone" in Tabbar.axml does not reclaim space (Status: CONFIRMED). 
As soon as it's fixed, using above approach seems to be a way to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With