iphone sdk中的UITableView LoadMore选项

时间:2011-01-24 21:41:14

标签: iphone uitableview

如何在UItableView中创建一个显示为“加载更多数据......”的单元格?单击时,此单元格将添加更多数据。与Twitter和Facebook类似。

任何源代码都会有很多帮助...

感谢您的帮助......

2 个答案:

答案 0 :(得分:0)

iPhone SDK Dev上查看此解决方案。

答案 1 :(得分:0)

我不会给你源代码,因为这很简单。它只需要一些非常基础的数学(加法)。

我会为你跑下来的:

在UITableViewDelegate中的“Section of Rows in Section:”方法中:

// you probably have "return [array count]" or return 89" in here.
// open up this file's .h file and declare "int rowCount"
// return here once you're done.
// change "return [array count] or return XX" to "return rowCount"

简单地将+25整数添加到“loadMoreData:”IBAction中声明的“int RowCount”,然后显式调用“Section of Rows in section:”以使其加载所有相同的数据,再加上25个单元格。如果您愿意,可以编辑+25,到+2903864765476842456275432,但请注意,您可能会崩溃您的应用程序。