[IOS]上拉显示更多数据例子(0 位领导批示)

最近研究了一下汽车之家手机客户端的上拉显示更多数据功能,写了一个简单的例子。

创建一个新项目,在rootView.h中加入下列代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@interface RootViewController : UITableViewController
{
    // 表格数据数组,因为是演示代码,直接定义为数组
	NSMutableArray *tableData;
    // 下拉时显示的数据
	NSMutableArray *tableMoreData;
 
    // 数据数量
	NSUInteger dataNumber;
 
    // 加载状态
	BOOL _loadingMore;
}
 
// 表格视图,需要与xib中的tableView关联
@property(nonatomic, retain) IBOutlet UITableView *tableView;
 
// 创建表格底部
- (void) createTableFooter;
 
// 开始加载数据
- (void) loadDataBegin;
// 加载数据中
- (void) loadDataing;
// 加载数据完毕
- (void) loadDataEnd;
@end

全文阅读 »

随机显示的10篇日志

评论最多的10篇日志

浏览最多的10篇日志