zoukankan      html  css  js  c++  java
  • [转]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,完全由自己手动来布局,就不会错乱了.

  • 相关阅读:
    hotel管理
    MySQL数据库的学习
    搭建纸飞机
    二维码
    Linux 的安装
    AngularJS学习笔记
    css3部分知识点
    如何处理数据
    jq跨域在127.0.0.1:8020上的写法
    AJAX请求方式
  • 原文地址:https://www.cnblogs.com/code-changeworld/p/4712851.html
Copyright © 2011-2022 走看看