iOS:disable scrollview's adjust contentInset

This commit is contained in:
pengfei.zhou 2020-03-13 16:43:40 +08:00 committed by osborn
parent 6cf0f4603e
commit e13d926b6c
5 changed files with 17 additions and 1 deletions

View File

@ -199,6 +199,9 @@ - (UICollectionView *)build {
it.dataSource = self;
[it registerClass:[DoricFlowLayoutViewCell class] forCellWithReuseIdentifier:@"doricCell"];
[it registerClass:[DoricFlowLayoutViewCell class] forCellWithReuseIdentifier:@"doricLoadMoreCell"];
if (@available(iOS 11, *)) {
it.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}];
}

View File

@ -94,6 +94,9 @@ - (UITableView *)build {
it.delegate = self;
it.separatorStyle = UITableViewCellSeparatorStyleNone;
it.allowsSelection = NO;
if (@available(iOS 11, *)) {
it.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}];
}

View File

@ -60,6 +60,9 @@ - (UIScrollView *)build {
it.pagingEnabled = YES;
[it setShowsVerticalScrollIndicator:NO];
[it setShowsHorizontalScrollIndicator:NO];
if (@available(iOS 11, *)) {
it.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}];
}

View File

@ -85,6 +85,9 @@ - (UICollectionView *)build {
it.delegate = self;
it.dataSource = self;
[it registerClass:[DoricSliderViewCell class] forCellWithReuseIdentifier:@"doricCell"];
if (@available(iOS 11, *)) {
it.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}];
}

File diff suppressed because one or more lines are too long