Status Bar in iOS7
2014-11-05 13:47
375 查看
This is a very important change in iOS 7: the status bar is no longer a separate bar. It’s now something that simply gets drawn on top of your view controllers. In previous versions of iOS, if your app displayed the status bar the height of the view controller’s view was reduced to compensate — especially if it contained a navigation bar. In iOS 7, your view controllers are always supposed to fill the entire screen.
If your app has content near the top of the screen but no navigation bar, then you have a problem on your hands, as the status bar will draw on top of that content. That’s exactly what’s happening on the Map Detail screen. There are three possible ways to handle this:
• Move your content down by 20 points and make room for the status bar. This is the easiest solution, but it doesn’t work very well if your content is embedded in a scroll view or relies on a table view.
• Implement the prefersStatusBarHidden method in your UIViewController subclass, and return YES to hide the status bar. The problem with this approach is that a user wants to keep the status bar visible in most non-game apps.
• Add a navigation bar on top, either by embedding the view controller inside a navigation controller, or by adding your own instance of UINavigationBar. The navigation bar will extend under the status bar. Your content will still sit under these two bars, but the navigation bar will blur it. This is the approach you’ll take in this tutorial.
--------iOS_7_by_Tutorials_1_1/Chapter 7: Transitioning to iOS 7 – What’s New with Auto Layout Page.244
If your app has content near the top of the screen but no navigation bar, then you have a problem on your hands, as the status bar will draw on top of that content. That’s exactly what’s happening on the Map Detail screen. There are three possible ways to handle this:
• Move your content down by 20 points and make room for the status bar. This is the easiest solution, but it doesn’t work very well if your content is embedded in a scroll view or relies on a table view.
• Implement the prefersStatusBarHidden method in your UIViewController subclass, and return YES to hide the status bar. The problem with this approach is that a user wants to keep the status bar visible in most non-game apps.
• Add a navigation bar on top, either by embedding the view controller inside a navigation controller, or by adding your own instance of UINavigationBar. The navigation bar will extend under the status bar. Your content will still sit under these two bars, but the navigation bar will blur it. This is the approach you’ll take in this tutorial.
--------iOS_7_by_Tutorials_1_1/Chapter 7: Transitioning to iOS 7 – What’s New with Auto Layout Page.244
相关文章推荐
- Status bar and navigation bar appear over my view's bounds in iOS 7
- Customizing Navigation Bar and Status Bar in iOS 7 .
- UIImagePickerController status Bar can not hidden in IOS 10
- Customizing Navigation Bar and Status Bar in iOS 7
- iOS7 navigation bar and status bar color issue
- iOS7 hide status bar
- Customizing Navigation Bar and Status Bar in iOS 7
- Showing progress bar in a status bar pane
- Customizing Navigation Bar and Status Bar in iOS 7
- ios7 set status bar
- IOS7 The Status Bar
- status bar in .plist,
- iOS7 table view embedded in tab bar doesn't display last cell
- How to: Display Command Information in the Status Bar在状态栏中显示命令信息
- Customizing Navigation Bar and Status Bar in iOS 7
- 添加 Search Bar in Table View-iOS7
- Keyboard、In-Call Status Bar的监听及视图位置改变调整(实例说明)
- How Creeate status Bar in MFC
- Showing progress bar in a status bar pane
- iOS7下隐藏status bar的详细研究