UIScrollView、UITableView、UICollectionView顶部空白问题解决:配置下面代码即可解决。
if (@available(iOS 11.0,*)) {self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;}else {self.automaticallyAdjustsScrollViewInsets = NO;}
如果觉得《iOS:UIScrollView UITableView UICollectionView顶部空白问题》对你有帮助,请点赞、收藏,并留下你的观点哦!