ios - Questions about navigation bar -
i confused relationship of navigation controller , content view controllers. in storyboard, navigation bar under navigation controller, linked
navigationcontrollerclass , customized navigation bar inviewdidloadfunction. however, since different content views have different navigation bar, different bar buttons, how can realize this? basic ideas enough. guess need specify specific bar buttons in specific content view controllers, sincenavigationbarproperty innavigationcontrollerclass, how can refer it?i want hide title of navigation bar , make bar show custom buttons (i know toolbar may match better, have other reasons adopt navigation bar). please tell me how hide title in detail , swift language preferred.
1) every viewcontroller instance has navigationcontroller property, it' optional. set bar buttons, you'll want use navigationitem. specify bar buttons either in interface builder per view controller, or or in viewdidload
let navbarbutton = uibarbuttonitem()...set bar button self.navigationitem?.leftbarbuttonitem = navbarbutton 2) hiding title trivial:
self.navigationitem?.title = ""
Comments
Post a Comment