edgesForExtendedLayout和automaticallyAdjustsScrollViewInsets
来源:互联网 发布:朝鲜没有网络吗 编辑:程序博客网 时间:2024/06/01 09:18
1、edgesForExtendedLayout
UIRectEdge edgesForExtendedLayout NS_AVAILABLE_IOS(7_0); // Defaults to UIRectEdgeAlltypedef NS_OPTIONS(NSUInteger, UIRectEdge) { UIRectEdgeNone = 0, UIRectEdgeTop = 1 << 0, UIRectEdgeLeft = 1 << 1, UIRectEdgeBottom = 1 << 2, UIRectEdgeRight = 1 << 3, UIRectEdgeAll = UIRectEdgeTop | UIRectEdgeLeft | UIRectEdgeBottom | UIRectEdgeRight}
edgesForExtendedLayout
指定边缘要延伸的方向,默认是UIRectEdgeAll,四周边缘全部延伸,就是说,如果即使视图中上有navigationBar,下有tabBar,那么视图仍会延伸覆盖到四周的区域。(有留心的小伙伴会看到它们的底部有类似磨砂的效果)
这是在IOS7以后 ViewController 开始使用全屏布局的,坐标原点从左上角开始。
为了不让tableView 不延伸到 navigationBar 下面, 属性设置为 UIRectEdgeNone
这时会发现导航栏变灰了,处理如下就OK了 self.navigationController.navigationBar.translucent = NO;
那 automaticallyAdjustsScrollViewInsets 呢?
2、automaticallyAdjustsScrollViewInsets
当 automaticallyAdjustsScrollViewInsets 为 NO 时,tableview 是从屏幕的最上边开始,也就是被导航栏 & 状态栏覆盖
当 automaticallyAdjustsScrollViewInsets 为 YES 时,也是默认行为,表现就比较正常了,
。automaticallyAdjustsScrollViewInsets是一个bool类型,默认为YES,也就是会自动校准滚动视图的嵌入视图。不过这个只针对于UIScrollView及其子视图
但是,测试结果很软肋,基本区别不大。。。但是对于解决一些Bug 是还是起作用的,比如说SearchBar的跳动问题,详情见:http://www.cnblogs.com/skyming/p/4059128.html, 其他UITableView,UIScrollView 位置的
问题多数和这3属性相关。。
- 关于edgesForExtendedLayout和automaticallyAdjustsScrollViewInsets
- edgesForExtendedLayout 和automaticallyAdjustsScrollViewInsets属性
- edgesForExtendedLayout和automaticallyAdjustsScrollViewInsets
- automaticallyAdjustsScrollViewInsets和edgesForExtendedLayout和extendedLayoutIncludesOpaqueBars
- 关于automaticallyAdjustsScrollViewInsets和 edgesForExtendedLayout的理解
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets、、
- edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets属性
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets、、
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- 析edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- layoutSubviews、drawRect、edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- iOS7 edgesForExtendedLayout&automaticallyAdjustsScrollViewInsets
- [IOS]edgesForExtendedLayout、automaticallyAdjustsScrollViewInsets
- edgesForExtendedLayout、extendedLayoutIncludesOpaqueBars、automaticallyAdjustsScrollViewInsets属性详解
- iOS中edgesForExtendedLayout与automaticallyAdjustsScrollViewInsets
- iOS中edgesForExtendedLayout与automaticallyAdjustsScrollViewInsets
- dlopen(), dlsym(), respondsToSelector:, performSelector:, method_exchan关于苹果禁用JSPatch(热修复一类),上架审核被拒问题
- Linux查看物理CPU、内存、硬盘等基本信息命令
- 山东大学项目实训——5月21日
- oracle 数据库 去重查询
- opengl 红宝书第一章 简介 所得记录 DHK
- edgesForExtendedLayout和automaticallyAdjustsScrollViewInsets
- J2EE系列之Hibernate4学习笔记(十四)--多对多映射
- 命令行参数(argc, argv)
- eclipse nl setting
- 给UIView/UIButton添加虚线边框
- 最新chromedriver对应chrome浏览器支持的版本明细
- 备忘录《一》基于cookie使用过滤器实现客户每次访问自登陆一次
- HTML关键字<7>
- 渲染管线—局部坐标到世界坐标的转换