過年回來一直搞ios7的項目適配,也算是有些眉目.
方法一:直接動用Window
#if __IPHONE_OS_VERSION_MAX_ALLOWED>=__IPHONE_7_0
[application setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.clipsToBounds =YES;
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
//added on 19th Sep
self.window.bounds =CGRectMake(0,20, self.window.frame.size.width,self.window.frame.size.height-20);
#endif
記得在info.plist裡面添上View controller-based status bar appearance 設置為NO
這樣項目會顯示出status bar
另外呢 就是一些帶有navigation bar 和tabbar的,會發現嵌套在裡面的viewcontroller中得view會上移64px,
這個可以選擇在viewcontroller裡面加上
self.edgesForExtendedLayout=UIRectEdgeNone;
當然 用xib的就方便了.
在xcode5上可以調制增量的
首先修改interface builder
opens in xcode5.0
view as ios7.0
記得把下面的use autolayout 的勾去掉<喎?/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+yLu688no1sPU9sG/LqH31eK+zcrH1Nppb3M3IM/C1MvQ0LXEyrG68tT2vNO24MnZLi7O0srH1eLDtMDtveK1xDwvcD4KPHA+PGltZyBzcmM9"/uploadfile/Collfiles/20140226/20140226092635228.png" alt="">
目前想到了這些,歡迎補充~