表格视图中的活动指示器
我有一个包含 xml 解析对象的表视图。
我想在此表视图中实现活动指示器,如果数据加载完成,活动指示器会自动停止。
如何做到这一点?
提前致谢
I have a tableview contains xml parsed objects.
I want to implement activity indicator in this tableview ,if the data loading is completed activity indicator stops automatically.
How to do this?.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,您需要进行异步调用来获取 xml 数据。
在进行调用之前启动活动指示器,然后在委托方法中,当您收到数据时停止活动指示器,代码如下所示。
First of all you need to make an async call to get your xml data.
Start your activity indicator before making the call then in the delegate method when you receive the data stop the activity indicator the code looks something like this.
完成解析操作后,向 tableview 类发出通知,在该方法中您可以重新加载 tableView 并停止活动指示器。
after finishing the parse operation, give a notification to the tableview class , in that method you can reload the tableView and also stop the activity indicator .
我希望,UITableView 的“- (void)endUpdates”可能是在表格完成所有操作后停止指示器的最佳位置。
I hope, UITableView's "- (void)endUpdates" could be best place to stop your indicator when everything is done with the table.