Xcode报错专区

Xcode9打包应用运行在iOS11上setContentOff

2017-10-30  本文已影响189人  Keep_FighterLS

uiscrollview-setcontentoffsetanimated-not-working-in-ios11 评论中找答案
如题:这种情况一般发生在UITableView上,UIScrollView没有类似问题

    _tableView.estimatedRowHeight = 0;// default is UITableViewAutomaticDimension, set to 0 to disable
    _tableView.estimatedSectionHeaderHeight =0;// default is UITableViewAutomaticDimension, set to 0 to disable
    _tableView.estimatedSectionFooterHeight =0; // default is UITableViewAutomaticDimension, set to 0 to disable

设置三种属性即可解决

iOS11 UITableView push 返回后有一个向下的动画

 if #available(iOS 11.0, *) {
        tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentBehavior.never
    } else {
        // Fallback on earlier versions
    }
if (@available(iOS 11.0, *)) {
      [UIScrollView appearance].contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} 
上一篇下一篇

猜你喜欢

热点阅读