iOS 知识库A知识点2复杂UI

iOS11 刷新TableView上下跳动

2017-11-29  本文已影响661人  z小志

AppDelegate 添加

if #available(iOS 11.0, *) {
            UITableView.appearance().estimatedRowHeight = 0;
            UITableView.appearance().estimatedSectionFooterHeight = 0;
            UITableView.appearance().estimatedSectionHeaderHeight = 0;
            UITableView.appearance().contentInsetAdjustmentBehavior = .never
        }
        

还有一种设置了 UITableView.appearance().contentInsetAdjustmentBehavior = .never 还是跳动
这时候你在当前界面可能设置的 estimatedRowHeight(预估高度太小)

上一篇下一篇

猜你喜欢

热点阅读