How to change Statusbar on Modal Views iOS 6

≡放荡痞女 提交于 2019-12-03 02:22:41

try this "hack": You have to add a navigation bar to your first view controller. Then you have two possibilities.

1) Set the alpha value of the navigation bar to 0

or

2) Set the y-position of the bar to -43px (look here: http://moduscreate.com/tinting-your-status-bar-in-ios6-and-phonegap/)

EDIT:

To get the right colors you have to set the tintColor of the invisible UINavigationBar. So by default set it black. In your button action you have to set the tintColor to your navigationController.navigationBar.tintColor. At the action of your close button you need to set it back to [UIColor blackColor].

The first view controller must have a navigation controller/bar for the feature to work. The status bar does not change color throughout your app (in iOS6) but adapts to the navigationbar color of you starting view. If your starting view does not contain a navigationbar, the status bar does not adapt color.! (See http://i.stack.imgur.com/n9ubK.png)

You don't have to set the style for the navigation bar to your tableviewcontroller.

Try this approach. 1. Add navigation controller to the main view. 2. Set its property hidden to yes. 3. When you display tableviewcontroller, set the navigation bar property hidden to No

Navigation Controller -> bar hidden= yes -> MainView -> bar hidden=no -> TableView

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!