automaticallyAdjustsScrollViewInsets(个人认为iOS7中略坑爹的属性)
来源:互联网 发布:catia软件旋转快捷键 编辑:程序博客网 时间:2024/04/28 21:18
@当我们在一个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
在controller中添加一句,self.automaticallyAdjustsScrollViewInsets = NO就行了
- automaticallyAdjustsScrollViewInsets(个人认为iOS7中略坑爹的属性)
- automaticallyAdjustsScrollViewInsets(个人认为iOS7中略坑爹的属性)
- 小胖说事11-------automaticallyAdjustsScrollViewInsets(个人认为iOS7中略坑爹的属性)
- iOS的automaticallyAdjustsScrollViewInsets属性
- iOS7中edgesForExtendedLayout、extendedLayoutIncludesOpaqueBars、automaticallyAdjustsScrollViewInsets的区别
- view controller的automaticallyAdjustsScrollViewInsets属性
- iOS的edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets属性
- automaticallyAdjustsScrollViewInsets属性
- iOS7 edgesForExtendedLayout&automaticallyAdjustsScrollViewInsets
- automaticallyAdjustsScrollViewInsets属性对布局的影响
- automaticallyAdjustsScrollViewInsets属性对布局的影响
- 个人认为比较的博客
- edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets属性
- edgesForExtendedLayout 和automaticallyAdjustsScrollViewInsets属性
- iOS开发-automaticallyAdjustsScrollViewInsets属性
- iOS 【automaticallyAdjustsScrollViewInsets 属性介绍】
- [IOS 开发] automaticallyAdjustsScrollViewInsets属性
- iOS开发-automaticallyAdjustsScrollViewInsets属性
- java实现任意进制的互相转换
- JavaScript面向对象编程——构造函数继承
- 就地交换两个数的值
- 苹果在中国面临的挑战:让用户为下载付费
- 反病毒工具-IDA
- automaticallyAdjustsScrollViewInsets(个人认为iOS7中略坑爹的属性)
- 在AndroidStudio中,使用Gradle打包aar到JCenter仓库!完整版教程!填补各种坑
- iOS学习1_初体验
- 大数据预测分析的四个关键因素
- 【C++】STL队列和栈的使用
- loadrunner运行用户设置
- Spring mvc+hibernate+freemarker(开源项目)
- 社会文化和媒体的主流宣传方式所导致的后果
- unity 如何改变游戏中鼠标样式