开发者

UITableView - hide all groups/cells while data is loading

I don't want to display my table view cells until the data has been loaded from an external source. I want to show an activity indicator over the table background while the data is loading. I can get the indicator to show by adding it as a subview to tableView, but I can't figure out how to hide the rows until they are ready to be displayed.

This is all being handl开发者_如何学编程ed in a UITableViewController. The table is displayed in a popover.


You may have differents solutions.
Maybe the first one and the faster, saying to the uiTableView datasource there is no section. Then when your externals datas are loaded, reload the tableView with the sections and rows.

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

Other solution, hide the uiTableView and set your activity indicator on an other view. But you need to avoid UITableViewController to achieve this ^^

Maybe the first solution would be the faster ;-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜