UITableView reloadData - 如何停止闪烁 [英] UITableView reloadData - how to stop flicker

查看:29
本文介绍了UITableView reloadData - 如何停止闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了 UITableView 闪烁的问题.

I have a problem with UITableView flicker.

我有一个隐藏 UITableView,我想在它显示给用户之前刷新它.这样做会导致 tableview 在它再次隐藏之前非常短暂地显示在所有其他 subview 之上.

I have a hidden UITableView that I want to refresh before it's shown to the user. Doing so causes the tableview to be displayed above all the other subview very briefly before it's hidden again.

即使是这样的代码也无济于事:

Even code like this isn't helping:

self.tableView.hidden = YES;
[self.tableView reloadData];
self.tableView.hidden = YES;

谁能提出解决方案?

蒂姆

推荐答案

我已经解决了这个问题.

I've solved this.

我需要从视图层次结构中删除表视图,重新加载数据,然后将其放回去!

I need to remove the table view from the view hierarchy, reload the data, then put it back!

这篇关于UITableView reloadData - 如何停止闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆