将UIActivityIndi​​cator添加到UITable

将UIActivityIndi​​cator添加到UITable

本文介绍了将UIActivityIndi​​cator添加到UITableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在表格视图中加载一些数据,而在后台进行此操作时,我想添加一个活动指示符,以显示进程正在进行,并在进程完成后隐藏。实现这样的最有效方法是什么?

I need to load some data in a table view and while this is going on in the background I want to add an activity indicator in order to show that there is a process going on and will hide once the process finishes. What would be the most efficient way to implement something like this?

推荐答案

取决于您是否要阻止您的用户和活动指示的重要性。

Depends, whether you want to block your user or not and also how important is the activity indication.

如果您不想阻止用户,请使用 Application.networkActivityIndi​​catorVisible ,如果你想拥有更大的活动指标但仍然不能阻止用户,请在表格视图( tableview.height - = activityview.height )下面用文本和UIActivityIndi​​cator为UIView设置动画,并且然后隐藏完成或如果您想阻止用户,请使用阻止活动指示器。

If you don't want to block user, use Application.networkActivityIndicatorVisible, if you want to have larger activity indicator and still not to block user, animate UIView with text and UIActivityIndicator below the table view (tableview.height -= activityview.height) and then hide on complete or if you would like to block user, use blocking activity indicator.



  • (我个人使用MBProgressHUD,它易于学习和使用)

  • http://www.dejal.com/developer/?q=developer/dsactivityview
  • https://github.com/jdg/MBProgressHUD (I was using MBProgressHUD personally and it's easy to learn and use)

这篇关于将UIActivityIndi​​cator添加到UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 08:25