[5]|[5] Safe Area Layout (iOS 11)
UIView
- 【[5]|[5] Safe Area Layout (iOS 11)】默认值:
View Controller 的 View 的 safeAreaInsets (在viewDidAppear 查看):
- 不在Navigation Controller中:{20, 0, 0, 0 }
- 在Navigation Controller中:{64, 0, 0, 0 }
- View Controller 的 additionalSafeAreaInsets : {0, 0, 0, 0 }
- 修改后:
修改View Controller 的 additionalSafeAreaInsets 后:
view.safeAreaInsets = view.safeAreaInsets + vc. additionalSafeAreaInsets
由 contentInsetAdjustmentBehavior 决定:
- never: adjustedContentInset = safeAreaInsets
- always: adjustedContentInset = contentInset + safeAreaInsets
- scrollableAxes:
可滚动方向: adjustedContentInset = contentInset + safeAreaInsets
可不滚动方向:adjustedContentInset = contentInset - automatic:
automaticallyAdjustsScrollViewInsets = YES: adjustedContentInset = contentInset + safeAreaInsets
automaticallyAdjustsScrollViewInsets = NO:与scrollableAxes 相同。
- iOS 11 安全区域适配总结
- Positioning Content Relative to the Safe Area
推荐阅读
- Element分析(工具篇)——TableLayout
- python|python GUI库图形界面开发之PyQt5布局控件QHBoxLayout详细使用方法与实例
- FlowLayout布局_UICollectionViewFlowLayout
- iOS|iOS 小知识
- git|git报错 fatal: unsafe repository
- 安卓五大布局
- 【转】Fail-Safe|【转】Fail-Safe,Fail-Fast Iterators in Java and ConcurrentModificationException
- cell穿透屏幕不同系统的适配以及safearea相关属性的分析
- iOS|iOS translucent edgesForExtendedLayout和extendedLayoutIncludesOpaqueBars的关系
- Qt入门|Qt QScrollArea