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

后端 未结 1 2048
醉话见心
醉话见心 2021-01-16 06:12

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:39

    Did you try adding the NavigationBar Delegate

    @interface MyClass : UIViewController <UINavigationBarDelegate>

    And the following method?

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

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

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