zoukankan      html  css  js  c++  java
  • automaticallyAdjustsScrollViewInsets (iOS)

    [摘要:@当我们正在一个UIViewController中同时建立2个tableView的时间,若是把它们的frame中的Y坐标设置为一样,您大概会发明它们的地位并出有到达您念要的效果.比方第一tableView个frame(0,0,320,568),另外一个]

    @当我们在一个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,完全由自己手动来布局,就不会错乱了.

  • 相关阅读:
    国内三大云数据库测试对比
    Nginx源码安装及调优配置
    如何在 CentOS 7 用 cPanel 配置 Nginx 反向代理
    开学了!这些Linux认证你要知道
    快速入门SaltStack
    WPF模板
    C#基础知识回顾-- 属性与字段
    程序员接私活经验谈[转]
    强烈推荐:240多个jQuery插件
    [Java]读取文件方法大全
  • 原文地址:https://www.cnblogs.com/akiha/p/5773558.html
Copyright © 2011-2022 走看看