uiscrollview-setcontentoffsetanimated-not-working-in-ios11 評(píng)論中找答案
如題:這種情況一般發(fā)生在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
設(shè)置三種屬性即可解決
iOS11 UITableView push 返回后有一個(gè)向下的動(dòng)畫
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentBehavior.never
} else {
// Fallback on earlier versions
}
if (@available(iOS 11.0, *)) {
[UIScrollView appearance].contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}