2010-04-22 71 views
2

我们最好的方式来分类从服务器拉出的大量结果吗?就服务器而言,我可以抵消和限制结果,所以我一次只能拉出25个,但是什么是让用户查看更多结果的最佳方式,而无需不断滚动应用商店等不断增长的列表应用程序吗?iPhone UITableView分页结果

感谢, 豪伊

回答

5

要在列表的底部,将获得下一组添加新的细胞,当你点击它,请执行下列操作

在...

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 

添加1个额外的行,如果有更多的检索

return totalCount > [list count]?[list count]+1:[list count] 

随后在...

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

最后一个单元格创建 '加载更多' 细胞,如果它需要

[[NSBundle mainBundle] loadNibNamed:@"LoadMoreCell" owner:self options:nil]; 
LoadMoreCell *cell = loadMoreCell; 
NSString *loadMore = [NSString string with Format:@"Load %d more...", numberToLoad]; 

然后在...

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 

做需要什么用新的数量更新表格视图中的项目列表

+0

感谢您的反馈意见。我实际上正在寻找一种替代解决方案,所以tableview不必保持增长。 – Ward 2010-04-22 16:13:16

+0

我很好奇@Ward,如果你想出任何东西,因为我不认为我曾经在iPhone应用程序中见过这种类型的用户体验。 – 2011-09-28 17:21:29