zoukankan      html  css  js  c++  java
  • IOS7升级攻略

    1) Select the main view, set the background color to black (or whatever color you want the status bar to be

    2) Make sure the background is a self contained subview positioned as a top level child of the controller's view.
    Move your background to become a direct child of the controller's view. Check the autosizing panel to be sure that you've locked all frame edges, activated both flexibility axes, and if this is a UIImageView, set the content mode to Scale to fill. Programmatically this translates to contentMode set to UIViewContentModeScaleToFill and has its auto resizing mask set to (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight).

    3) Now move everything that is locked to the top - down by 20 pts and set a iOS 6/7 delta Y to -20.
    All top level children that are locked to the top frame in the autosizing panel need to be moved down by 20pts and have their iOS 6/7 delta Y set to -20. (Cmd select all of those, and click down arrow 20 times - is there a better way anyone?)

    4) Adjust the iOS 6/7 delta height of all of the above items that had a flexible height. Any of the items that were locked to the frame top and bottom and had flexible height enabled in the autosizing panel must also have their iOS 6/7 delta height set to 20. That includes the background view mentioned above. This may seem anti-intuitive, but due to the order in which these are applied, it is necessary. The frame height is set first (based on device), then the deltas are applied, and finally the autosizing masks are applied based upon the offset positions of all of the child frames - think it through for a bit, it will make sense.

    5) Finally, items that were locked to the bottom frame but not the top frame need no deltas at all.

    That will give you the identical status bar in iOS7 and iOS6.

    On the other hand, if you want iOS7 styling while maintaining iOS6 compatibility, then set the delta Y / delta height values to 0 for the background view.

    To see more iOS7 migration info read the full post: http://uncompiled.blogspot.com/2013/09/legacy-compatible-offsets-in-ios7.html

  • 相关阅读:
    Android上的远程调试
    使用Chrome DevTools的Timeline和Profiles提高Web应用程序的性能
    用Chrome开发者工具做JavaScript性能分析
    查看html元素绑定的事件与方法的利器
    Chrome的JS调试工具
    作为Web开发人员,我为什么喜欢Google Chrome浏览器
    构造方法
    方法的带参
    OOP类和对象
    循环结构进阶
  • 原文地址:https://www.cnblogs.com/lingzhao/p/3343051.html
Copyright © 2011-2022 走看看