关于UITableView中的 TableFooterView的使用介绍
2011-10-14 11:14
477 查看
用UITableViewDelegate中的这个方法:
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath;
判定tableView中的数组数是否即将显示最后一个cell,if (indexPath.row == [self.dataArr count]-1)
如果是的话,self.tableView.tableFooterView = footSpinnerView;//footSpinnerView为自定义的UIView,上面加了一个旋转的UIActivityIndicatorView即可,记得让UIActivityIndicatorView startAnimation
加上你关于刷新数组的逻辑,如从数据库中取出更多的数据,取完数据后,将self.tableView.tableFooterView设nil即可。
#pragma mark -
#pragma mark UITableViewDelegate
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == [self.productArr count]-1) {
[self setupFootSpinnerView];
self.tableView.tableFooterView = footSpinnerView;
if (currentArrCount < dataCount) {
currentArrCount += 5;
self.dataArr = [dao getArrayOfDataLimit:currentArrCount offset:0];//从数据库中重新取数据
[self.tableView reloadData];
}else{
self.tableView.tableFooterView = nil;
}
}
}
转载: http://topic.csdn.net/u/20110308/16/a1cc693b-f5db-422f-a04e-143a0d933750.html
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath;
判定tableView中的数组数是否即将显示最后一个cell,if (indexPath.row == [self.dataArr count]-1)
如果是的话,self.tableView.tableFooterView = footSpinnerView;//footSpinnerView为自定义的UIView,上面加了一个旋转的UIActivityIndicatorView即可,记得让UIActivityIndicatorView startAnimation
加上你关于刷新数组的逻辑,如从数据库中取出更多的数据,取完数据后,将self.tableView.tableFooterView设nil即可。
#pragma mark -
#pragma mark UITableViewDelegate
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == [self.productArr count]-1) {
[self setupFootSpinnerView];
self.tableView.tableFooterView = footSpinnerView;
if (currentArrCount < dataCount) {
currentArrCount += 5;
self.dataArr = [dao getArrayOfDataLimit:currentArrCount offset:0];//从数据库中重新取数据
[self.tableView reloadData];
}else{
self.tableView.tableFooterView = nil;
}
}
}
转载: http://topic.csdn.net/u/20110308/16/a1cc693b-f5db-422f-a04e-143a0d933750.html
相关文章推荐
- 关于UITableView中的 TableFooterView的使用介绍
- 关于设置 UITableView 的 tableHeaderView为使用了 SnapKit 约束的自定义 view 时出现的 BUG 的处理
- UITableView总结:基本使用方法介绍
- 关于使用uitableview 中cell 来实现uiimageview的复用和图片的异步加载
- UITableView的介绍及使用
- UITableView 使用及常用方法介绍
- 关于UITableView的简单使用
- 关于UIScrollView的简单使用及介绍
- Android WebView系列文章1-关于WebView基本使用介绍
- 【iOS开发】关于UITableView的cell循环使用
- iphone开发之表格组件UITableView的使用(一)使用时的具体步骤介绍
- iOS,UITableView详细介绍之基本使用(一)
- 超全的关于UITabview 使用介绍
- 关于UITableView中删除某一行方法的使用
- 关于UITABLEVIEW的使用说明
- 关于UITableView使用
- Swift UITableView 使用的简单介绍
- Swift UITableView 使用的简单介绍
- 关于UITableView的使用整理
- 关于UITableView的一点使用心得