博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iOS之返回按钮
阅读量:4289 次
发布时间:2019-05-27

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

//返回按钮

-(void)addbackBtn{

    

    UIButton *bbtn=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 60, 30)];

    [bbtn setImage:[UIImage imageNamed:@"icon_navigation_back"] forState:UIControlStateNormal];

    [bbtn addTarget:self action:@selector(backBtn) forControlEvents:UIControlEventTouchDown];

    UIBarButtonItem *fixBtn=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];

    fixBtn.width=-30;

    UIBarButtonItem *backbtn=[[UIBarButtonItem alloc]initWithCustomView:bbtn];

    NSArray *btnArr=@[fixBtn,backbtn];

    self.navigationItem.leftBarButtonItems=btnArr;

}

-(void)backBtn{

   

        [self.navigationController popViewControllerAnimated:YES];

    

}

转载地址:http://kcmgi.baihongyu.com/

你可能感兴趣的文章
HTTP协议原理
查看>>
python正则表达式模块re
查看>>
python爬虫总结
查看>>
python网络编程基础--http
查看>>
python 构造http请求对象-Request对象
查看>>
解决Ubuntu16.04更新源时显示“暂时不能解析域名”问题
查看>>
Ubuntu16.04运行清空文件命令时提示权限不够解决方法
查看>>
shell脚本编写笔记
查看>>
Ubuntu16.04实现定时免密远程拷贝脚本
查看>>
Ubuntu 16.04安装Docker
查看>>
Docker报错:Temporary failure in name resolution&Proxy Authentication Required
查看>>
mySQL常用操作及基础知识
查看>>
Ubuntu16.04安装python3.6
查看>>
linux安装Anaconda
查看>>
Ubunu16.04安装CPU版本Tensorflow
查看>>
conda常用命令和基础知识整理
查看>>
ImportError: libgfortran.so.4: cannot open shared object file: No such file or directory
查看>>
Django搭建网站笔记
查看>>
不抱怨的世界
查看>>
运动减肥篇
查看>>