首页 > 其他 > 详细

tableView reloadData页面跳动问题

时间:2019-12-21 14:12:54      阅读:343      评论:0      收藏:0      [点我收藏+]

参考: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];
    }];

tableView reloadData页面跳动问题

原文:https://www.cnblogs.com/huaida/p/12076561.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!