ios - Questions about navigation bar -


  1. i confused relationship of navigation controller , content view controllers. in storyboard, navigation bar under navigation controller, linked navigationcontroller class , customized navigation bar in viewdidload function. 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, since navigationbar property in navigationcontroller class, how can refer it?

  2. 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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -