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