首页 > 移动平台 > 详细

Status Bar in iOS7

时间:2014-11-05 14:37:43      阅读:266      评论:0      收藏:0      [点我收藏+]

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

Status Bar in iOS7

原文:http://www.cnblogs.com/scaptain/p/4076195.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!