Custom navigation bar

前端 未结 6 602
故里飘歌
故里飘歌 2021-01-30 03:19

I was crawling Dribble and found the attached design. I was wondering how to do a custom navigation bar like this. I mean how create the navigation bar once and reuse it implici

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 04:10

    You can use the stock UINavigationController and hide the UINavigationBar.

    Then, make your own subclass of UIViewController which has all of the navigation elements, and then a flexing size view where the contents go. Make all of your classes subclass this element and draw into the view. The button simply has to call [self.navigationController popViewControllerAnimated:YES] and the UILabel at view just has to set its text to self.title.

提交回复
热议问题