转自http://m.blog.csdn.net/blog/humingtao2013/27662093

automaticallyAdjustsScrollViewInsets(个人认为iOS7中略坑爹的属性)

@当我们在一个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

哈哈,由此可见,当我们一个界面有多个tableView之类的,要将它设置为NO,完全由自己手动来布局,就不会错乱了.

最新文章

  1. Solr4.0 如何配置使用UUID自动生成id值
  2. ie 7/8不支持trim的属性的解决方案
  3. 重写UIPageControl实现自定义按钮
  4. linux系统灵活运用灯[android课程3]
  5. [翻译]ASP.NET Web API 2入门
  6. vimium快捷键列表
  7. Linux httpd 跳转简单方法一
  8. JAVA课程设计个人博客 学生成绩管理 201521123023 戴建钊
  9. 洛谷P3268 [JLOI2016]圆的异或并(扫描线)
  10. leetcode — best-time-to-buy-and-sell-stock
  11. 我的第一个python web开发框架(27)——定制ORM(三)
  12. docker简单介绍----镜像和容器管理
  13. Centos7.0下MySQL的安装
  14. 十万的License只取决于一个连接
  15. 逆地址解析协议RARP
  16. day10--异步IO\数据库\队列\缓存
  17. 【RF库测试】对出错的处理
  18. 【JAVA】虚拟机指令集
  19. C++11中std::bind的使用
  20. Time-series Storage Layer Time Series Databases 时间序列

热门文章

  1. django-返回客户端外网ip服务
  2. sql server之exists用法
  3. 简单总结ConcurrentHashMap
  4. dataTable 中数据的居中显示
  5. Memcache笔记01-Memcache的安装
  6. SPM-软件项目管理之感想
  7. HDU 5469 Antonidas (树形DP,暴力)
  8. UVA 10572 Black & White (状压DP)
  9. 目后佐道IT教育的品牌故事
  10. Python学习日志9月14日