iOS7适配解决方案
1.
问题描述:
在iOS7上scrollview 可自由拖动
解决方案:
//ios7默认为YES if ([self respondsToSelector:@selector(setAutomaticallyAdjustsScrollViewInsets:)]) { [selfsetAutomaticallyAdjustsScrollViewInsets:NO]; }
2.
问题描述:
有navigation bar的情况下y坐标直接从状态栏(status bar)开始计算
解决方案:
if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) { [selfsetEdgesForExtendedLayout:UIRectEdgeNone]; }
3.
问题描述:
因为iOS7视图状态栏和连在了一起,所以有可能会有20px的偏移
解决方案:
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { self.view.bounds = CGRectMake(self.view.frame.origin.x, -20, self.view.frame.size.width, self.view.frame.size.height); }