How to add custom navigation bar to a full-screen VC in iOS 7 and make it tint the status bar to match?

后端 未结 1 636
闹比i
闹比i 2021-01-16 06:23

In an app I\'m developing (Xcode 5, >=iOS 7 auto-layout), I push a modal view controller. I want the modal view controller to have a navigation bar, so I add one, and add a

1条回答
  •  孤街浪徒
    2021-01-16 06:29

    Did you try adding the NavigationBar Delegate

    @interface MyClass : UIViewController

    And the following method?

    - (UIBarPosition)positionForBar:(id )bar {
        return UIBarPositionTopAttached;
    }
    

    And remember to add a constraint of 20 from the top.

    0 讨论(0)
提交回复
热议问题