Need wantsFullScreenLayout behavior with NON-translucent bars on iOS 7

女生的网名这么多〃 提交于 2019-12-03 17:41:54

问题


I want to be able to have my view cover the whole screen (go behind the navigation and tool bars) with the translucent property of the navigationBar and toolbar set to NO (I want non-transparent bars).

This was easy to accomplish prior to iOS 7 by setting wantsFullScreenLayout to YES. However, in iOS 7, I can't find any way of doing this. Any ideas?


回答1:


wantsFullScreenLayout is deprecated at iOS 7. Try setting your view controller's edgesForExtendedLayout property to UIRectEdgeAll

The iOS 7 Transition Guide mentions a few of the new view controller differences on page 17. However, the documentation states that if you're using opaque bars (as in your case) you should also set:

extendedLayoutIncludesOpaqueBars = YES;

EDIT

.. because by default it is NO. This conflicts with the iOS 7 Transition Guide which states the default value is YES. Be warned.




回答2:


picker.edgesForExtendedLayout = YES;


来源:https://stackoverflow.com/questions/19190876/need-wantsfullscreenlayout-behavior-with-non-translucent-bars-on-ios-7

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