Replacing UINavigationControllers NavigationBar with UIView

后端 未结 2 1729
情书的邮戳
情书的邮戳 2021-01-23 22:21

I am developing app that has multiple skins and I have a dilemma on how to implement this.

One of the solutions would be to have separate nib files for every skin, and lo

相关标签:
2条回答
  • 2021-01-23 23:00

    No way, what you are doing is perfect. This will work & no way it will get rejected from app store (just based on this approach). I too have explored several ways to provide skins & what you wrote seemed to be the least hassle-some. Plus its way more easier to create UI elements in Interface Builder hence the separate nib files for different skins.

    I am saying this so confidently 'coz I have done the same thing & app store approved.

    Best of luck.

    0 讨论(0)
  • 2021-01-23 23:15

    If you choose to hide & replace the UINavigationBar with your own UIView it's no problem as far as Apple goes.

    However, I can tell you that you will have to spend some time trying to replicate some visual effects that come naturally with UINavigationBar.

    For example, when you push/pop a new controller, you will see that the navigation bar title will slide & fade beautifully. The same applies for left and right bar items.

    Personally I would not completely hide the UINavigationBar, but customize it. In the end it all depends on what you want, but by default the UINavigationBar is pretty customizable.

    You can add your own buttons or even entire UIViews as left and right bar items. Also, you can add your own UIView as the title (with your own label, custom font or whatever) or change the background.

    EDIT:

    To easily customize the looks in your entire application, you can subclass UINavigationController and create your own CustomUINavigationController. Then, in viewDidLoad method you can change whatever you want to the navigation bar and this will be accessible in the entire application.

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