UITableView更新时需要采取什么预防措施?(what precautions are required when a UITableView is updating? (e.g. lockin

系统教程 行业动态 更新时间:2024-06-14 17:03:52
UITableView更新时需要采取什么预防措施?(what precautions are required when a UITableView is updating? (e.g. locking it?))

在某种程度上更新UITableView时应该“锁定”吗?

也就是说,在UITableView的数据刷新期间(假设需要几秒钟),应该以某种方式锁定视图本身,以便用户无法点击行等。

只是想知道开发者应该采取哪些预防措施(如果有的话)。

Should one "lock" a UITableView whilst it is updating somehow?

That is, during a data refresh for a UITableView (assuming it takes a few seconds), should one be somehow locking the view itself so that users can't click through on rows etc?

Just wondering what precautions (if any) a developer should take here.

最满意答案

取决于上下文。 一种常见的解决方案是,如果不能保证表格的内容在加载完成后仍然有效,则应使用半透明的全屏覆盖视图来显示活动指示器或进度条。 如果您只是加载新数据,即表中的旧数据仍然有效,例如当您刷新新闻提要或类似内容时,应该不需要锁定任何内容。

Depends on the context. A common solution, when there’s no guarantee that the contents of the table will still be valid once the load completes, is to cover it with a semitransparent full-screen overlay view displaying an activity indicator or a progress bar. If you’re just loading new data, though—i.e. the old data in the table is still valid, like when you’re refreshing a news feed or similar—there shouldn’t be a need to lock anything.

更多推荐

本文发布于:2023-04-24 12:16:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/25caff267e2d4459c03c0779d3910e25.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:预防措施   时需   UITableView   precautions   locking

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!