UIButton *back = [UIButton buttonWithType:UIButtonTypeCustom];

back.titleLabel.font = [UIFont boldSystemFontOfSize:13];

[back setTitle:@"Back" forState:UIControlStateNormal];

[back setFrame:CGRectMake(5, 2, 52, 30)];

[back setBackgroundImage:[UIImage imageNamed:@"bar_return"] forState:UIControlStateNormal];

[back addTarget:self action:@selector(popDiyView) forControlEvents:UIControlEventTouchUpInside];

UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:back];

self.navigationItem.leftBarButtonItem = barButton;

修改导航栏背景  和导航栏标题颜色

[self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:46/255.0 green:46/255.0 blue:56/255.0 alpha:1.0]];
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];

IOS UINavigationController 更改返回按钮的更多相关文章

  1. iOS学习—— UINavigationController的返回按钮与侧滑返回手势的研究

    侧滑返回手势是从iOS7开始增加的一个返回操作,经历了两年时间估计iPhone用户大部分都已经忽略了屏幕左上角那个碍眼的back按钮了.之前在网上搜过有关侧滑手势的技术博客,发现大多比较散乱,甚至有很 ...

  2. (ios实战) UINavigationBar 返回按钮 文本自定义实现

    在实际开发过程, 我们使用navigationController时,上一个标题过长,导致下一个界面的返回按钮文本过长,比较难看,如果标题取名过短,又不能完全表达含义. 下面时如何实现返回按钮的Tit ...

  3. navigationController 的返回按钮自定义

    1: navigationController 的返回按钮自定义 SecondViewController *secondVC = [SecondViewController new];       ...

  4. iOS: 动态更改 backBarButtonItem 的 title

    先来看一下 UIBarItem 的 title 的描述 The title displayed on the item. You should set this property before add ...

  5. iOS学习——更改导航栏的返回按钮的标题与颜色

    转载自:修改navigationController返回按钮颜色和文字 今天在做项目时遇到这个问题,试了很多方法都失败了.最后终于找到正确的方案了,在这里分享给大家. 引言 在iOS开发过程中,Nav ...

  6. iOS 自定义UINavigationController返回按钮

    主要代码如下: //自定义导航栏返回按钮 self.navigationItem.leftBarButtonItem = ({ //导航栏返回背景视图 UIView *view = [[UIView ...

  7. iOS导航栏背景,标题和返回按钮文字颜色

    在iOS7下,默认导航栏背景,颜色是这样的,接下来我们就进行自定义,如果你仅仅是更改一下背景和颜色,代码会很简单,不需要很复杂的自定义View来替代leftBarItem 更改导航栏的背景和文字Col ...

  8. ios 修改导航条返回按钮

    ios 修改导航条返回按钮 方式一:使用系统的:可以更改系统的文字:以及通过设置导航条的颜色来达到预期的效果 UIBarButtonItem *backBtns = [[UIBarButtonItem ...

  9. IOS 改变导航栏返回按钮的标题

    IOS 改变导航栏返回按钮的标题   下午又找到了一个新的方法 这个方法不错 暂时没有发现异常的地方. 新写的App中需要使用UINavigationController对各个页面进行导航,但由于第一 ...

随机推荐

  1. Burpsuite之Burp Collaborator模块介绍

    Burp Collaborator.是从Burp suite v1.6.15版本添加的新功能,它几乎是一种全新的渗透测试方法.Burp Collaborator.会渐渐支持blind XSS,SSRF ...

  2. pycharm使用方法

    https://blog.csdn.net/zhaihaifei/article/details/51658425

  3. nginx: [error] CreateFile() "E:\nginx\nginx-1.9.3/logs/nginx.pid" failed

    nginx: [error] CreateFile() "E:\nginx\nginx-1.9.3/logs/nginx.pid" failed nginx: [error] Op ...

  4. Codeforces 1043F(容斥+dp)

    题目链接 题意 是否存在选择方案使所选的数$gcd=1$ 思路 $f[i][j]$表示选$i$个数$gcd=j$的方案数,$cnt[i]$表示包含因子$i$的数的个数,则$f[i][j]=$$C_{c ...

  5. luogu P3172 [CQOI2015]选数

    传送门 颓了一小时柿子orz 首先题目要求的是\[\sum_{x_1=l}^{r}\sum_{x_2=l}^{r}...\sum_{x_n=l}^{r}[gcd(x_1,x_2...x_n)=k]\] ...

  6. 第25月第6天 apachecn视频(机器学习实战)

    1.apachecn视频(机器学习实战) https://github.com/apachecn/AiLearning https://space.bilibili.com/97678687/#/ch ...

  7. 【报错】java.lang.ClassNotFoundException: org.apache.ibatis.session.SqlSession

    报错 java.lang.ClassNotFoundException: org.apache.ibatis.session.SqlSession 或者 java.lang.ClassNotFound ...

  8. 比较python类的两个instance(对象) 是否相等

    http://www.yihaomen.com/article/python/281.htm 比较python类的两个instance(对象) 是否相等 作者:轻舞肥羊 日期:2012-10-25 字 ...

  9. [转载]Tensorflow 的reduce_sum()函数的axis,keep_dim这些参数到底是什么意思?

    转载链接:https://www.zhihu.com/question/51325408/answer/125426642来源:知乎 这个问题无外乎有三个难点: 什么是sum 什么是reduce 什么 ...

  10. ssh连接报错server responded”algorithm negotiation failed”

    ssh工具版本太低,OpenSSL版本升的比较高,有些算法不支持. 解决方法: 1.修改ssh的配置文件 /etc/ssh/sshd_config cd /etc/sshvi /etc/ssh/ssh ...