- 1. Safe Area
- 2. table
- 3. Navigation
- Navigation 集成 UISearchController
- UINavigationController和滚动交互
- UIScrollView and UITableView的新特性
- 如果有一些文本位于UI滚动视图的内部,并包含在导航控制器中,现在一般
navigationContollers
会传入一个contentInset
给其最顶层的viewController
的scrollView
,在iOS11中进行了一个很大的改变,不再通过scrollView
的contentInset
属性了,而是新增了一个属性:adjustedContentInset
,通过下面两种图的对比,能够表示adjustContentInset
表示的区域:
新增的contentInsetAdjustmentBehavior属性用来配置adjustedContentInset的行为,该结构体有以下几种类型:
typedef NS_ENUM(NSInteger, UIScrollViewContentInsetAdjustmentBehavior) {
UIScrollViewContentInsetAdjustmentAutomatic,
UIScrollViewContentInsetAdjustmentScrollableAxes,
UIScrollViewContentInsetAdjustmentNever,
UIScrollViewContentInsetAdjustmentAlways,
}
@property(nonatomic) UIScrollViewContentInsetAdjustmentBehavior contentInsetAdjustmentBehavior;
@property(nonatomic, readonly) UIEdgeInsets adjustedContentInset;
//adjustedContentInset值被改变的delegate
- (void)adjustedContentInsetDidChange;
- (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView;