Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add it to TabbedPage #6

Open
bluekuen opened this issue Apr 25, 2018 · 3 comments
Open

How to add it to TabbedPage #6

bluekuen opened this issue Apr 25, 2018 · 3 comments

Comments

@bluekuen
Copy link

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

@edooley
Copy link

edooley commented Sep 9, 2018

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)

@ElderLars
Copy link

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();
                }

@ughunter
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants