CustomNavigationBarSample
CustomNavigationBarSample copied to clipboard
How to add it to TabbedPage
Hello,
i love your navigation bar but i need it in a TabbedPage. Can you give me a hint how to do this because i can't get it done.
Looking forward for your answer bluekuen
Bump. LOVE THIS but having the same problem in iOS (works fine for me in Android).
When implementing this in a TabbedPage, the ViewWillAppear has a null NavigationController in CustomNavigationBarSample.iOS.Renderers.CustomPageRenderer
. I think it has something to do with the way iOS has separate UINavigationControllers inside of each tab of UITabBarController.
It would be really awesome to have this sorted out. I was determined to hunt it down but ran out of time under a tight deadline so I'm using this for Android but just using NavigationPage.SetTitleIcon(this, "my_icon"); for iOS (all I needed)
Add did solve it like this in my code: Added a custom property in MyNavigationPage called GetUseParentParent() that is true in tabbed pages. It is used in the SetupNavBar(CGSize size). Like this:
if (MyNavigationPage.GetUseParentParent(Element))
{
ParentViewController.ParentViewController.NavigationItem.TitleView = containerView;
ParentViewController.ParentViewController.NavigationItem.TitleView.SetNeedsDisplay();
}
else
{
ParentViewController.NavigationItem.TitleView = containerView;
ParentViewController.NavigationItem.TitleView.SetNeedsDisplay();
}
Perfect solution. But I can’t apply it to tabs. Please, help! Android Application.Current.MainPage = new CustomNavigationView(new MainView());
MainView : TabbedPage into MainView xaml <views:MyCardsView x:Name="MyCardsPage" />
MyCardsView : CustomView
CustomView and CustomNavigationView - from this project