iOS 设置导航栏全透明
- (void)viewWillAppear:(BOOL)animated{
//设置导航栏背景图片为一个空的image,这样就透明了
[self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
//去掉透明后导航栏下边的黑边
[self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];
}
- (void)viewWillDisappear:(BOOL)animated{
// 如果不想让其他页面的导航栏变为透明 需要重置
[self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:nil];
}
作者:诠释残缺
链接:http://www.jianshu.com/p/9746b8bd6707
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
iOS 设置导航栏全透明的更多相关文章
- ios 设置导航栏背景色
//设置导航栏背景色 如果上面的不好用 就用下面的 [self.navigationController.navigationBar setBackgroundImage:[UIImage image ...
- IOS 设置导航栏
//设置导航栏的标题 self.navigationItem setTitle:@"我的标题"; //设置导航条标题属性:字体大小/字体颜色…… /*设置头的属性:setTitle ...
- IOS 设置导航栏全局样式
// 1.设置导航栏背景 UINavigationBar *bar = [UINavigationBar appearance]; [bar setBackgroundImage:[UIImage r ...
- iOS 设置导航栏之二(设置导航栏的颜色、文字的颜色、左边按钮的文字及颜色)
#import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicati ...
- iOS 设置导航栏的颜色和导航栏上文字的颜色
#import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @pr ...
- iOS设置导航栏样式(UINavigationController)
//设置导航栏baritem和返回baiitem样式 UIBarButtonItem *barItem = [UIBarButtonItem appearance]; //去掉返回按钮上的字 [bar ...
- IOS设置导航栏字体大小及颜色
方法一: 自定义视图,定义一个lable,相关属性在lable里设置 核心方法: self.navigationItem.titleView = titleLabel; 方法二:用系统方法直接设置 [ ...
- iOS设置导航栏标题
方法一:在UIViewController中设置self.title. 方法二:设置self.navigationItem.titleView.
- 导航栏全透明效果, 只保留左右两个按钮, 如何实现?以及关于NavigationController的小问题
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageWithColor:[UIColor clearCo ...
随机推荐
- 部署hadoop的开发环境
第一步:安装jdk 由于hadoop是java开发的,所以需要JDK来运行代码.这里安装的是jdk1.6. jdk的安装见http://www.cnblogs.com/tommyli/archive/ ...
- log4j(六)——log4j.properties简单配置样例说明
一:测试环境与log4j(一)——为什么要使用log4j?一样,这里不再重述 二:老规矩,先来个栗子,然后再聊聊感受 (1)使用配文件的方式,是不是感觉非常的清爽,如果不在程序中读取配置文件就更加的清 ...
- mysql常用查询语句
一.查询指定schema下表的个数 select count(TABLE_NAME) from information_schema.tables where table_schema="d ...
- Mysql按数字大小排序String字段
问题是这样的,当我们按由大到小的顺序排序一组数字的时候,它应该如此: 9800 8000 900 但如果是这些数字是以String类型存储的话,直接排序的结果会是这样: 9800 900 8000 当 ...
- Oracle 12C -- shutdown CDB
SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- ...
- RHEL7 禁用gnome-inital-setup
每次登陆系统后,都会跳出页面gnome-inital-setup 如果觉得讨厌,可以禁止该页面的出现: mkdir ~/.config echo "yes" >> ~/ ...
- Android HttpURLConnection源代码分析
Android HttpURLConnection源代码分析 之前写过HttpURLConnection与HttpClient的差别及选择.后来又分析了Volley的源代码. 近期又遇到了问题,想在V ...
- systemd的程序自启动脚本编写
以FreeSWITCH的自启动脚本为例. 一. 编写freeswitch.service文件 [Unit] Description=FreeSWITCH After=syslog.target net ...
- 【Qt】StackedWidget
一个简单的堆栈窗体类: 左側列表框会出现不同的选项,右側显示所选的不同的窗口 #include<QHBoxLayout> #include "stackdlg.h" S ...
- [转]21分钟 MySQL 入门教程
目录 一.MySQL的相关概念介绍 二.Windows下MySQL的配置 配置步骤 MySQL服务的启动.停止与卸载 三.MySQL脚本的基本组成 四.MySQL中的数据类型 五.使用MySQL数据库 ...