博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ios 点击navbar 标题栏 tableview返回顶部
阅读量:7058 次
发布时间:2019-06-28

本文共 510 字,大约阅读时间需要 1 分钟。

hot3.png

1、设置navbar触摸事件

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];}

转载于:https://my.oschina.net/u/554046/blog/627100

你可能感兴趣的文章
iphone开发
查看>>
解决:在微信中访问app下载链接提示“已停止访问该网页”
查看>>
使用阿里云ECS自建RDS MySQL从库
查看>>
Linux下sed命令
查看>>
胃病犯了怎么办
查看>>
三星2610打印机故障INTERNAL ERROR - Incomplete Session by time out
查看>>
马哥2016全新Linux+Python高端运维班第五周作业
查看>>
VLAN Tagging VST, EST & VGT on VMWare vSphere
查看>>
JavaScript 中 apply 、call 的详解
查看>>
thinkphp 跨模块调用配置文件信息
查看>>
nohup命令在后台自动执行程序
查看>>
java-第六章-for-循环录入会员信息
查看>>
HQL中 "* only allowed inside aggregate function in SELECT 错误"
查看>>
Linux下 android 开发环境配置
查看>>
MAVEN项目后 jar包无法发布到eclipse的web服务器
查看>>
选择结构与循环结构
查看>>
Linux系统生成随机密码的10种方法
查看>>
puppet初体验
查看>>
lnmp 编译安装
查看>>
Python tools for Penetration Tester
查看>>