tableView reloadData頁面跳動問題


參考:https://www.jianshu.com/p/5f033fdd4ddb

 

一般情況下

if (@available(iOS 11.0, *)) {

        self.estimatedRowHeight = 0;

        self.estimatedSectionFooterHeight = 0;

        self.estimatedSectionHeaderHeight = 0;

        self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

    }

可以解決

但是如果有切換不同類型cell的需求,還是會跳動

需要將簡單的reloadData替換為

[UIView performWithoutAnimation:^{ [self reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone]; }]; [UIView performWithoutAnimation:^{ [self reloadData]; }];


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM