CosmicMind / Material

A UI/UX framework for creating beautiful applications.
http://cosmicmind.com
MIT License
11.99k stars 1.26k forks source link

navigationItem properties are not working #1140

Closed manas-somoy closed 6 years ago

manas-somoy commented 6 years ago

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.

daniel-jonathan commented 6 years ago

Did you set in your Storyboard the NavigationController and NavigationBar class names in the Xcode editor.

manas-somoy commented 6 years ago

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.

OrkhanAlikhanov commented 6 years ago

As far as I remember navigationItem.title and navigationItem.{left|right}Views can only be manipulated via code. That's a limitation.

daniel-jonathan commented 6 years ago

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!

manas-somoy commented 6 years ago

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.

OrkhanAlikhanov commented 6 years ago

@CHONUMAN Please send us a project that replicates the issue.

manas-somoy commented 6 years ago

ok i got it. i have to set the NavigationBar class in the storyboard. Thanks for the help.

daniel-jonathan commented 6 years ago

@CHONUMAN awesome. If you need any further help, please reopen or create a new issue. Thank you!