rem*_*its 4 uitableview uiscrollview ios
我希望在视图滚动到底部时加载更多数据,即上拉刷新,但我不知道如何显示如下所示的"加载更多..."等单词并停止该单元格的tableview,因为如果使用
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:10 inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
Run Code Online (Sandbox Code Playgroud)
有一个错误:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '-[TNTableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:]: row (10) beyond bounds (0) for section (0).'
如果tableView没有数据,则加载更多仍然位于底部单元格,例如,一个表格可以显示9行,如果没有用于tableview的数据,则"加载更多"单元格位于第10行.
我在AppCoda网站上找到了一个很好的例子,尝试在你的应用程序中使用它.
http://www.appcoda.com/pull-to-refresh-uitableview-empty/
我已经在我的应用程序中使用了它确实有效...而且它可能正是你要找的东西.
归档时间: |
|
查看次数: |
6027 次 |
最近记录: |