Closed manas-somoy closed 6 years ago
Did you set in your Storyboard the NavigationController
and NavigationBar
class names in the Xcode editor.
yes. I subclassed both NavigationController and BottomNavigationController then set them in storyboard. The navigationcontroller could not set the tabbaritem in the prepare() method. Instead i had to override the init?(coder aDecoder: NSCoder) method to set it.
Also a different issue. I did the same without the storyBoard. BottomNavigationController -> NavigationController -> UIViewController. Where BottomNavigation is the initial view set in appdelegate. this time the status bar wont appear. If i click another tab that does not have a NavigationController the status bar appears. If I switch back the NavigationController of the previous viewcontroller hides it again.
As far as I remember navigationItem.title
and navigationItem.{left|right}Views
can only be manipulated via code. That's a limitation.
They need to be set programmatically, that is correct. The navigation items will need to be set in the root view controller of the NavigationController as per usual. If there is a failure to this, please send us a project that replicates the issue. Thank you!
I was setting them programatically. But they wont appear if I set the navigation class in the storyboard. Can anyone give me proper directions how to proceed if I follow "BottomNavigation -> NavigationController -> ViewController" design. I prefer working with story boards. If I subclass them and set them in storyboards I need to know which methods to implement/override so the changes in properties will work.
@CHONUMAN Please send us a project that replicates the issue.
ok i got it. i have to set the NavigationBar class in the storyboard. Thanks for the help.
@CHONUMAN awesome. If you need any further help, please reopen or create a new issue. Thank you!
When I set a NavigationController as a viewcontroller of a BottomNavigationController in storyboard I am setting the navigation titlelabel, leftviews etc from the rootviewcontroller of the NavigationController but they are not appearing when I run.