OC代码如下:
if (@available(iOS 11.0, *)) {
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
StoryBoard中还需要注意在为tableview布局添加约束时,点击数值右侧的向下箭头,选择“View(current distance = 0)”,不要选“Top Layout Guide(current distance = 0)”
网友评论