视频iPad版因为一些历史原因一直没有适配iOS7,之前团队里一直用iOS6的SDK编译提交App。2014.02.01以后苹果只允许提交Xcode5编译的App并要求新版本必须适配iOS7。
还是由于一些历史原因(我们之前是做魔拍的),iPad版之前有几个团队维护过,里面的代码内容很庞杂(你懂的)。下面的适配iOS7的技巧只适合于想保存iOS6界面风格,但需要支持iOS7的SDK编译需求,避免产生不兼容的界面。
如果App是按照典型的VC管理的,没有使用容器VC的管理方式。可以按如下只添加Category的方式处理。
1 @implementation UIViewController(Layout) 2 3 -(int) edgesForExtendedLayout; 4 { 5 return 0; 6 } 7 8 -(BOOL) extendedLayoutIncludesOpaqueBars; 9 { 10 return NO; 11 } 12 13 -(BOOL) automaticallyAdjustsScrollViewInsets; 14 { 15 return NO; 16 } 17 18 @end
使用Category的方式强制VC输出iOS6样式的布局,好处是不用大幅度修改代码。