@当我们在一个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. 换个角度理解云计算之HDFS
  2. 多态、类库、委托、is和as运算符、泛型集合
  3. <转>Npoi导入导出Excel操作<载>
  4. Yii增删改查操作
  5. Kinect For Windows V2开发日志九:侦测并绘制人体骨架
  6. FPGA使用技巧
  7. SGU 146.The Runner
  8. hidden change事件
  9. ArcGis地理坐标系转投影坐标系问题的思考与处理
  10. Linux的wget命令详解【转载】
  11. SQL Server Management Studio 使用技巧
  12. TCP回射服务器修订版(ubuntu 18.04)
  13. VirtualBox查看虚拟机IP地址
  14. 阿里的Json解析包FastJson使用
  15. U盘上安装Ubuntu系统 便捷式系统 - 赖大大
  16. idea使用优化
  17. [Python设计模式] 第6章 衣服搭配系统——装饰模式
  18. MySQL中的数据类型以及完整性约束
  19. Anya and Cubes CodeForces - 525E (双端搜索)
  20. VIM_manual

热门文章

  1. B.小A与任务
  2. hdu6311( 2018 Multi-University Training Contest 2)
  3. [HDU1595] find the longest of the shortest
  4. Unity Shader入门精要学习笔记 - 第3章 Unity Shader 基础
  5. springmvc当要返回中文字符串时出现乱码
  6. asp也玩三层架构(有源代码)
  7. 事件冒泡之cancelBubble和stoppropagation的区别
  8. leetcode140 Word Break II
  9. SQLServer查询死锁
  10. ios UI自动化测试