I created a tabbed page and set the navigation bar to the bottom. Now I need to hide the Navigation Bar on a specific page. For iOS I used this Renderer: here, but I couldn't found a similar solution for Android. I tried it with this:
public TabbedPageRendererDroid(Context context) : base(context)
{
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName == "IsHidden")
{
TabLayout TabsLayout = null;
for (int i = 0; i < ChildCount; ++i)
{
Android.Views.View view = (Android.Views.View)GetChildAt(i);
if (view is TabLayout)
TabsLayout = (TabLayout)view;
}
if ((Element as CustomTabbedPage).IsHidden)
{
TabsLayout.Visibility = ViewStates.Invisible;
}
else
{
TabsLayout.Visibility = ViewStates.Visible;
}
}
}
This does only work with a normal navigation bar on top, but not with a bottom navigation bar and the app crashes with this Error: System.NullReferenceException
.
Is there any solution for Android, thanks in advance.