关于UINavigationController的一些技巧
未自定义任何东西的导航条效果如下:

1、自定义了 leftBarButtonItem 之后,左滑返回手势失效了,解决办法:
self.navigationController.interactivePopGestureRecognizer.delegate = (id)self;
2、去掉 back
// 让默认返回“back”向上偏移 64
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(.f, -.f)
forBarMetrics:UIBarMetricsDefault];
3、修改 "<back"颜色
// 导航条文字和默认箭头颜色
[[UINavigationBar appearance] setTintColor:[UIColor redColor]];
4、修改导航条背景颜色
// 导航条背景颜色
[[UINavigationBar appearance] setBarTintColor:[UIColor lightGrayColor]];
5、滑动时隐藏、下拉是出现到导航。该属性为iOS8之后出现
// 滑动时隐藏、下拉是出现到导航。该属性为iOS8之后出现
self.navigationController.hidesBarsOnSwipe = YES;
6、修改 navigationBar 为透明色
[self.navigationController.navigationBar setBackgroundImage:[UIImage new]
forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [UIImage new];
self.navigationController.navigationBar.translucent = YES;
7、起初statusbar是lightcontent的,但是使用 UIImagePickerController 导致statusbar的样式变成黑色,解决办法
// 起初statusbar是lightcontent的,但是使用 UIImagePickerController 导致statusbar的样式变成黑色,解决办法:
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}
尊重作者劳动成果,转载请注明: 【kingdev】
关于UINavigationController的一些技巧的更多相关文章
- UINavigationController技巧<一>——修改返回按钮的标题
UINavigationController 一般push到另一界面后,返回按钮标题便是上一页面的title,但是对于push的第一页或者是上一页面没有title的,返回按钮标题便是默认back,如图 ...
- iOS:小技巧(不断更新)
记录下一些不常用技巧,以防忘记,复制用. 1.获取当前的View在Window的frame: UIWindow * window=[[[UIApplication sharedApplication] ...
- ios开发中的小技巧
在这里总结一些iOS开发中的小技巧,能大大方便我们的开发,持续更新. UITableView的Group样式下顶部空白处理 //分组列表头部空白处理 UIView *view = [[UIViewal ...
- UI第六节——UINavigationController 详解
1. UINavigationController 是一个容器类.里面盛放的是UIViewController. 容器的意思是,如果你不放入UIViewController,里面就是空的,什么也没有. ...
- iOS小技巧总结,绝对有你想要的
原文链接 在这里总结一些iOS开发中的小技巧,能大大方便我们的开发,持续更新. UITableView的Group样式下顶部空白处理 //分组列表头部空白处理 UIView *view = [[UIV ...
- iPhone开发中的技巧整理
1.NSCalendar用法 -(NSString *) getWeek:(NSDate *)d { NSCalendar *calendar = [[NSCalendar alloc] initWi ...
- iOS开发——控制器OC篇&UINavigationController&UITabBarController详解
UINavigationController&UITabBarController详解 一:UINavigationController 控制器的属性: UINavigationControl ...
- [ios-必看] IOS调试技巧:当程序崩溃的时候怎么办 iphone IOS
from:http://article.ityran.com/archives/1143 有这样一种情形:当我们正在快乐的致力于我们的app时,并且什么看都是无比顺利,但是突然,坑爹啊,它崩溃了.(悲 ...
- [ios2] 开发技巧【转】
1.NSCalendar用法 -(NSString *) getWeek:(NSDate *)d { NSCalendar *calendar = [[NSCalendar alloc] initWi ...
随机推荐
- 通俗理解 React 高阶函数
定义:高阶组件就是一个函数,且该函数接受一个组件作为参数,并返回一个新的组件. A higher-order component is a function that takes a componen ...
- 《SQL 进阶教程》 case:将已有编号方式转换为新的方式并统计
SQL 权威指南SQL 解惑在进行非定制化统计时,需要将已有编号方式转换为另外一种便于分析的方式进行统计需求 select case when name='哈尔滨' then '黑龙江' when n ...
- js 创建方法
贴个代码先: function O(user,pwd){ //use constructor this.user=user; this.pwd=pwd; this.get=get; return th ...
- HDU-2586-How far away(LCA Tarjan离线算法)
链接:https://vjudge.net/problem/HDU-2586 题意: 勇气小镇是一个有着n个房屋的小镇,为什么把它叫做勇气小镇呢,这个故事就要从勇气小镇成立的那天说起了,修建小镇的时候 ...
- Codeforces 161D(树形dp)
\(dp[v][k]\)代表以\(v\)的子树为起点,以点\(v\)为终点长度为\(k\)的方案有多少种. 转移只需将子树加和:计算\(ans\)由两部分组成,一是\(dp[v][k]\),另一部分是 ...
- c++11 thread的学习
http://www.cnblogs.com/wxquare/p/6736202.html 还没开始 留个链接 使用c++11 thread支持实现 一个生产者消费者模型 下面是一个生产者消费者问题 ...
- poj 2406 Power Strings 后缀数组解法
连续重复子串问题 poj 2406 Power Strings http://poj.org/problem?id=2406 问一个串能否写成a^n次方这种形式. 虽然这题用kmp做比较合适,但是我们 ...
- PHP&Java 调用C#的WCF
步骤一:用C#声明WCF [ServiceContract] public interface IService1 { [OperationContract] void DoWork(); [Oper ...
- 使用Zeppelin时出现sh interpreter not found错误的解决办法(图文详解)
不多说,直接上干货! 问题详解 http://192.168.80.145:8099/#/notebook/2CSV2VT5S 相关博客是 Zeppelin的入门使用系列之使用Zeppelin运行sh ...
- mysql explain 的extra中using index ,using where,using index condition,using index & using where理解
using index :查找使用了索引,查询结果覆盖了索引 using where:查找使用了索引,不需要回表去查询所需的数据,查询结果是索引的一部分 using index condition:查 ...