分页和UITableView? [英] Paging and UITableView?

查看:72
本文介绍了分页和UITableView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为UITableView行添加分页?当用户垂直滚动UITableView时,它会更改行!

Is possible to add a pagination for UITableView rows?When the user scrolls vertically the UITableView it change rows!

推荐答案

您可以使用方法tableView:willDisplayCell:forRowAtIndexPath:在底部添加更多行.每次将要显示行之前都会调用此方法.在该方法中,检查该行是否对应于数据源中的最后一项.如果是,请在末尾添加更多行.

You can use the method tableView:willDisplayCell:forRowAtIndexPath: for adding more rows at the bottom. This method is called every time before a row is about to be displayed. In the method, check if the row is corresponding to the last item in your data source. If yes, add more rows at the end.

if(indexPath.row == [self.items count] - 1) //items is your data source
{
      [self addMoreItems];
}

这篇关于分页和UITableView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆