参考链接:
http://stackoverflow.com/questions/3660313/present-a-default-view-instead-of-tableview-if-datasource-is-empty
关键应用:
I solved this problem by adding a UIView in the tableview header with a frame size equal to tableview size and disallowing user interaction on the tableview:
UIView *emptyView = [[UIView alloc] initWithFrame:self.tableView.frame];
self.tableView.tableHeaderView = emptyView;
self.tableView.userInteractionEnabled = NO;
When you have data you just remove the header and reenable user interaction:
self.tableView.tableHeaderView = nil;
self.tableView.userInteractionEnabled = YES;
可以实现类似于android中listview的emptyview的效果。