ios 点击navbar 标题栏 tableview返回顶部
2016-03-02 00:00
288 查看
1、设置navbar触摸事件
2、tableview返回顶部
2、tableview返回顶部
- (void)viewDidLoad { [super viewDidLoad]; self.navigationController.navigationBar.userInteractionEnabled=YES; UITapGestureRecognizer * tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(scrollToTop:)]; [self.navigationController.navigationBar addGestureRecognizer:tap]; } -(void)scrollToTop:(UITapGestureRecognizer *)sender{ [self.tableView setContentOffset:CGPointMake(0,-50) animated:YES]; }
相关文章推荐
- iOS开发 ---- Xcode清除多余的证书provisioning profile,清除缓存
- GIT版本控制工具
- iOS 基础 (一)
- ios手势解锁(详解和源码)
- xcode7 dylib换为tbd
- iOS摄像头和照片库
- IOS 调用苹果地图
- iOS推送机制
- iOS开发设计模式之代理
- iOS----ARC(自动内存管理)
- iOS @property retain关键字的使用
- ios-基础之【4】-协议
- iOS开发设计模式之MVC
- ios-基础之【3】-类的延展
- ios-基础之【2】-类目的概念和使用
- IOS从.plist文件中读取内容,创建一个图片浏览器
- iOS自己封装控件
- 使用Core Animation对象来实现动画
- iOS实践03
- ios 支付宝支付流程