[IOS]SVPullToRefresh的使用
来源:互联网 发布:unity3d 获取脚本组件 编辑:程序博客网 时间:2024/06/06 17:37
[IOS]SVPullToRefresh的使用
SVPullToRefresh使用比较简单,只要一行语句即可实现下拉并刷新。比EGOPullToRefresh更简单。
GitHub地址:https://github.com/samvermette/svpulltorefresh
Demo地址:http://download.csdn.net/detail/u012881779/8477137
#import "SVViewController.h"#import "SVPullToRefresh.h"@interface SVViewController ()<UITableViewDelegate , UITableViewDataSource>@property (strong, nonatomic) IBOutlet UITableView *tableView;@end@implementation SVViewController- (void)viewDidLoad { [super viewDidLoad]; _tableView.delegate = self; _tableView.dataSource = self; //下拉刷新 __weak SVViewController * weakVC = self; [weakVC.tableView addPullToRefreshWithActionHandler:^{ [weakVC refreshAction]; [weakVC performSelector:@selector(stopRefreshAnimation) withObject:nil afterDelay:3]; }];}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning];}//下拉刷新-(void)refreshAction{ [_tableView reloadData];}//停止下拉刷新-(void)stopRefreshAnimation{ [self.tableView.pullToRefreshView stopAnimating];}#pragma mark UITableViewDataSource- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ return 1;}- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return 20;}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell==nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } [cell.textLabel setText:[NSString stringWithFormat:@"%d",indexPath.row]]; return cell;}#pragma mark UITableViewDelegate- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 50;}@end
示图:
0 0
- [IOS]SVPullToRefresh的使用
- SVPullToRefresh的用法
- iOS中的下拉刷新SVPullToRefresh
- iOS中的下拉刷新SVPullToRefresh
- iOS中的下拉刷新SVPullToRefresh
- iOS中的下拉刷新SVPullToRefresh
- 下拉刷新 SVPullToRefresh 的使用及两个比较优秀的第三方下拉刷新
- 使用第三方Refresh控件都与遇到的问题 --SVPullToRefresh
- 使用SVPullToRefresh 报错 需要注意 以及一些刷新方法
- 使用开源库 SVPullToRefresh 实现上拉加载下拉刷新
- 使用开源库 SVPullToRefresh 实现上拉加载下拉刷新
- SVPullToRefresh[第三方]下拉刷新上拉加载使用
- SVPullToRefresh 同时进行上拉和下拉刷新的问题
- 谈谈SVPullToRefresh
- SVPullToRefresh问题解决
- IOS常用第三方框架 --- SVPullToRefresh 下拉刷新、上拉加载更多
- SVPullToRefresh深入理解
- SVPullToRefresh深入理解
- Android--快速地搜索手机文件引擎小程序(File I/O)
- ios开发之asihttprequest数据离线缓存与读取
- js 操作字符串
- MongoDB 副本集自动复制 Replica Set
- java注解实现map与bean之间的转换
- [IOS]SVPullToRefresh的使用
- Spring Test 整合 JUnit 4 使用总结
- 循环-01. 求整数段和(15)
- C++中的bitset的使用和简介
- Java图片高优化压缩
- C# 中的委托和事件
- ios 获取屏幕分辨率
- Android 4.4 音量调节流程分析
- java中只有值传递,没有引用传递