automaticallyAdjustsScrollViewInsets(个人认为iOS7中略坑爹的属性)
2015-06-12 12:04
507 查看
@当我们在一个UIViewController中同时创建2个tableView的时候,如果把它们的frame中的Y坐标设置为一样,你可能会发现它们的位置并没有达到你想要的结果.比如第一tableView个frame(0,0,320,568),另一个也frame(0,0,320,568),结果会发现第二个tableView的第一行数据被导航栏遮挡了,以至于我们不得已把第二个frame改成(0,64,320,568-64),虽然效果变成了我们想要的,但是却不知道这是什么原因.......
其实这一切都是automaticallyAdjustsScrollViewInsets在作怪,我们可以先看一下官方文档中对它的描述:
automaticallyAdjustsScrollViewInsets
Specifies whether or not the view controller should automatically adjust its scroll view insets.
@property(nonatomic, assign) BOOL automaticallyAdjustsScrollViewInsets
Discussion
Default value is
YES, which allows the view controller to adjust its scroll view insets in response to the screen areas consumed by the status bar, navigation bar, and toolbar or tab bar. Set toNO if you want to manage scroll view inset adjustments
yourself, such as when there is more than one scroll view in the view hierarchy.
Availability
Available in iOS 7.0 and later.
Declared In
UIViewController.h
在controller中添加一句,self.automaticallyAdjustsScrollViewInsets = NO就行了
其实这一切都是automaticallyAdjustsScrollViewInsets在作怪,我们可以先看一下官方文档中对它的描述:
automaticallyAdjustsScrollViewInsets
Specifies whether or not the view controller should automatically adjust its scroll view insets.
@property(nonatomic, assign) BOOL automaticallyAdjustsScrollViewInsets
Discussion
Default value is
YES, which allows the view controller to adjust its scroll view insets in response to the screen areas consumed by the status bar, navigation bar, and toolbar or tab bar. Set toNO if you want to manage scroll view inset adjustments
yourself, such as when there is more than one scroll view in the view hierarchy.
Availability
Available in iOS 7.0 and later.
Declared In
UIViewController.h
在controller中添加一句,self.automaticallyAdjustsScrollViewInsets = NO就行了
相关文章推荐
- 联想G510进入BIOS的两种方法
- 第三章:nagios邮件提醒
- ios html5 设定PhoneGap开发环境
- iOS不规则按钮实现
- IOS AVFoundation QRCode Scan
- IOS CIFilter QRCode Generate
- Xamarin iOS教程之申请付费开发者账号下载证书
- iOS 局部变量 setTag后可在别的地方调用 viewWithTag
- iOS开发中出现的奇葩问题
- IOS开发--源码篇 MBProgressHUD
- IOS已解决 在构建版本上传后, 一直处于处理状态
- IOS开发--枚举类型使用
- ios6、7 版本适配
- 那些在学习iOS开发前就应该知道的事(part 2)
- iOS 拨打电话功能
- iOS 数据持久化
- 第二章:nagios监控for windows
- iOS沙盒路径的查看和使用
- iOS autolayout的Content Hugging 和 Content Compression Resistance
- ios 中pch 文件里面的预编译命令符