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,完全由自己手动来布局,就不会错乱了.
automaticallyAdjustsScrollViewInsets (iOS)的更多相关文章
- iOS开发-automaticallyAdjustsScrollViewInsets属性
iOS开发-automaticallyAdjustsScrollViewInsets属性 Available in iOS 7.0 and later. 简单点说就是automaticallyAdju ...
- iOS UITableviewWrapperView 和 automaticallyAdjustsScrollViewInsets属性
关于在navigationController下面使用tableView在竖直方向会遇到frame的y值的困惑, 会遇到视图控制器的这个属性:automaticallyAdjustsScrollVie ...
- iOS automaticallyAdjustsScrollViewInsets
self.automaticallyAdjustsScrollViewInsets = NO; //在当前VC内修改这个属性就可以解决这个问题了. 当前以TableView为主View的ViewCon ...
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
在IOS7以后 ViewController 开始使用全屏布局的,而且是默认的行为通常涉及到布局 就离不开这个属性 edgesForExtendedLayout,它是一个类型为UIExtendedEd ...
- iOS中的translucent和automaticallyAdjustsScrollViewInsets用法
关于这两个属性我长话短说 具体的可以更具具体情况来设置: translucent用法 automaticallyAdjustsScrollViewInsets用法 translucent用法 iOS7 ...
- iOS edgesForExtendedLayout、extendedLayoutIncludesOpaqueBars、automaticallyAdjustsScrollViewInsets属性详解
edgesForExtendedLayout: 在IOS7以后 ViewController 开始使用全屏布局的,而且是默认的行为通常涉及到布局,就离不开这个属性 edgesForExtendedLa ...
- ios 常见问题解决
一,libxml/HTMLparser.h file not find 第一种方法: 点击左边项目的根目录,再点击右边的Build Settings,手工输入文字:“Header search pat ...
- 【转】iOS学习之translucent属性
原文地址:http://www.jianshu.com/p/930643270455 总所周知,苹果从iOS7开始采用扁平化的界面风格,颠覆了果粉们"迷恋"的拟物化风格.对于开发者 ...
- iOS项目开发中的知识点与问题收集整理②(Part 二)
1.点击UIButton 无法产生触摸事件 如果在UIImageView中添加了一个按钮,你会发现在默认情况下这个按钮是无法被点击的,需要设置UIImageView的userInteractio ...
随机推荐
- ORACLE AWR性能报告和ASH性能报告的解读
数据库的性能分析可分为会话级和系统级:如果确定某个会话存在性能问题,最常见的分析方式是对这个会话做一个SQL_TRACE或者10046事件,通过分析trace文件来定位问题所在.如果无法确定哪个会话性 ...
- 30分钟学习sea.js使用指南
: seajs如何解决? ①引入sea.js的库 <script src="../sea/sea.js" ></script> ②如何变成模块? defin ...
- 【bootstrap】时间选择器datetimepicker和daterangepicker
在bootstrap中的时间选择器有两种:dateTimePicker和dateRangePicker 1.dateTimePicker好像是官方嫡插件: 需要的文件: <link rel= ...
- 用Karma和Jasmine测试Angular应用
TEST: Before you've written any of the code, you know how you want it to behave. You have a specific ...
- mac 终端下ssh 登录远程服务器不发输入中文
转:https://segmentfault.com/q/1010000000150673 用Mac的iterm2 ssh连上去,终端显示中文乱码,也不能输入中文,然而本地终端可以显示和输入. 解决方 ...
- 【Python之路】第九篇--Python基础之线程、进程和协程
进程与线程之间的关系 线程是属于进程的,线程运行在进程空间内,同一进程所产生的线程共享同一内存空间,当进程退出时该进程所产生的线程都会被强制退出并清除.线程可与属于同一进程的其它线程共享进程所拥有的全 ...
- spring的校验框架 @Validated & BindingResult
controller上写法类似这样: @RequestMapping(value = "saleInfoList.json", method = RequestMethod.GET ...
- vim menu乱码
syntax enable syntax on colorscheme desert set nocompatible set filetype=c set number set wrap " ...
- 如何获取本机IP
GetLocalHost 直接通过InetAddress.getLocalHost()来获取,其主要逻辑如下 InetAddress.getLocalHost(): String hostname = ...
- Unity 5 Game Optimization
2. Scripting Strategies 2.1 Cache Component references (缓存组件引用) 使用 Rigidbody rigidbody = GetComponen ...