iOS11上废除了automaticallyAdjustsScrollViewInsets这个方法,所以造成iOS11机型顶端留白问题
解决方法:
if (@available(iOS 11.0, *)) {
self.tableview.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
网友评论