iOS 导航栏风格
IOS-导航栏风格
导航控制器可以用几种不同的风格来显示自身。默认风格就是标准的灰色外观。目前支持三种不同的风格。
|
风 格 |
描 述 |
|
UIBarStyleDefault |
默认风格;灰色背景,白色文字 |
|
UIBarStyleBlack |
纯黑色背景,白色文字 |
|
UIBarStyleBlackOpaque |
纯黑色背景,白色文字 |
|
UIBarStyleBlackTranslucent |
透明黑色背景,白色文字 |

风格是通过barStyle属性来设置的。这个属性属于导航控制器,而不是视图控制器,因此在各个视图之间来回切换时,此属性可以保持一致:
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
IOS中原文档如下:
UIBarStyle
Defines the stylistic appearance of different types of views.
typedef enum {
UIBarStyleDefault = 0,
UIBarStyleBlack = 1,
UIBarStyleBlackOpaque = 1, // Deprecated
UIBarStyleBlackTranslucent = 2, // Deprecated
} UIBarStyle;
Constants
UIBarStyleDefault
Use the default style normally associated with the given view. For example, search bars and tool bars typically use a blue gradient background.
Available in iOS 2.0 and later.
Declared in UIInterface.h.
UIBarStyleBlack
Use an opaque black style.
Available in iOS 3.0 and later.
Declared in UIInterface.h.
UIBarStyleBlackOpaque
Deprecated. Use UIBarStyleBlack instead.
Available in iOS 2.0 and later.
Declared in UIInterface.h.
UIBarStyleBlackTranslucent
Deprecated. Use UIBarStyleBlack and set the translucent property to YES instead.
Available in iOS 2.0 and later.
Declared in UIInterface.h.
导航控制器可以用几种不同的风格来显示自身。默认风格就是标准的灰色外观。目前支持三种不同的风格。
|
风 格 |
描 述 |
|
UIBarStyleDefault |
默认风格;灰色背景,白色文字 |
|
UIBarStyleBlack |
纯黑色背景,白色文字 |
|
UIBarStyleBlackOpaque |
纯黑色背景,白色文字 |
|
UIBarStyleBlackTranslucent |
透明黑色背景,白色文字 |

风格是通过barStyle属性来设置的。这个属性属于导航控制器,而不是视图控制器,因此在各个视图之间来回切换时,此属性可以保持一致:
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
IOS中原文档如下:
UIBarStyle
Defines the stylistic appearance of different types of views.
typedef enum {
UIBarStyleDefault = 0,
UIBarStyleBlack = 1,
UIBarStyleBlackOpaque = 1, // Deprecated
UIBarStyleBlackTranslucent = 2, // Deprecated
} UIBarStyle;
Constants
UIBarStyleDefault
Use the default style normally associated with the given view. For example, search bars and tool bars typically use a blue gradient background.
Available in iOS 2.0 and later.
Declared in UIInterface.h.
UIBarStyleBlack
Use an opaque black style.
Available in iOS 3.0 and later.
Declared in UIInterface.h.
UIBarStyleBlackOpaque
Deprecated. Use UIBarStyleBlack instead.
Available in iOS 2.0 and later.
Declared in UIInterface.h.
UIBarStyleBlackTranslucent
Deprecated. Use UIBarStyleBlack and set the translucent property to YES instead.
Available in iOS 2.0 and later.
Declared in UIInterface.h.
iOS 导航栏风格的更多相关文章
- iOS 屏幕原点坐标 && 导航栏风格的自定义
其一 屏幕原点坐标 (x ,y) 受 self.navigationController. navigationBar 的 setTranslucent (BOOL) 属性控制 在 iOS7 以后 ...
- 转:ios导航栏设置
原帖:http://www.cocoachina.com/industry/20131104/7287.html 本文提供的代码需要用Xcode 5来执行.如果你还在使用老版本的Xcode,那么在运行 ...
- IOS 导航栏属性设置
IOS 7 以上系统导航栏: [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; // 返回按钮颜色 [UINaviga ...
- IOS导航栏的使用方法
本文是使用纯代码实现一个导航栏的效果.单击按钮并且产生事件.基本思路是: 1.创建一个导航栏(UINavigationBar对象) 2.创建一个导航栏集合(UINavigationItem对象) 3. ...
- 保持UIImagePickerController后导航栏风格统一
1. UIImagePickerController 状态栏始终保持某一种风格. -(void)navigationController:(UINavigationController *)navig ...
- 【Swift】iOS导航栏错乱的原因
#iOS开发高级技巧#导航栏错乱,也就是导航栏的显示效果与内容区不匹配,引发原因很多,其中最重要的有两个原因: 1.在viewwillappear,viewwilldisappear两个函数中,设置导 ...
- iOS导航栏背景,标题和返回按钮文字颜色
在iOS7下,默认导航栏背景,颜色是这样的,接下来我们就进行自定义,如果你仅仅是更改一下背景和颜色,代码会很简单,不需要很复杂的自定义View来替代leftBarItem 更改导航栏的背景和文字Col ...
- iOS 导航栏黑线,UIImage 枚举处理方式
ios 找出导航栏下面的黑线(可隐藏,改变样式等) http://www.jianshu.com/p/effa4a48f1e3 设置UIImage的渲染模式:UIImage.renderi ...
- ios 导航栏的显示和隐藏切换
从简单的一个没有导航栏的界面A push到另一个有导航栏的界面 B,在界面A的逻辑中加入下面逻辑: 屏幕快照 2016-03-30 上午10.35.24.png 这样完美的处理了这个场景变换需求.引起 ...
随机推荐
- 关于eclipse部署项目后,在tomcat中的webapps文件夹下没有项目
转自:https://blog.csdn.net/yang505581644/article/details/78802316 一.发现问题 在eclipse中新建Dynamic Web Projec ...
- bzoj 1502 月下柠檬树【Simpson积分】
投影到地面之后,会发现圆形在平行光下面积和形状是不会变的,也就是所要求的图形是若干个圆和把相邻两个圆连起来的公切线所组成的. 公切线和圆间距瞎求一下就行,注意要去掉被完全覆盖的圆 然后simpson即 ...
- thinkphp数据库查重方法
$test_data = M('hot'); //实例化数据表 $data = $test_data->Distinct(true)->field('descriprion')->o ...
- SELinux的启动和关闭
1.SELinux简介 SELinux是Security Enhanced Linux的缩写,字面上的意思就是安全强化的Linux,它是由美国国家安全局 (NSA) 开发的,整合到Linux核心的一个 ...
- Keras 文档阅读笔记(不定期更新)
目录 Keras 文档阅读笔记(不定期更新) 模型 Sequential 模型方法 Model 类(函数式 API) 方法 层 关于 Keras 网络层 核心层 卷积层 池化层 循环层 融合层 高级激 ...
- virtualenv杂记
Linux复制命令: cp sourcedir destdir (如果是复制文件夹,增加参数 -a) Linux重命名命令:mv 旧的名称 新的名称 通过xshell查看虚拟机的配置:通过命令 ...
- pytest单侧模块_入门汇总
Pytest简单介绍 (pytest是python的一个测试框架,主要是用来进行一些小的测试) 安装:pip install -U pytest 查看是否安装成功:pytest --version 运 ...
- Qt对象模型之一:信号和槽
一.信号和槽机制概述 信号槽是 Qt 框架引以为豪的机制之一.所谓信号槽,实际就是观察者模式.当某个事件发生之后,比如,按钮检测到自己被点击了一下,它就会发出一个信号(signal).这种发出是没有目 ...
- 题解报告:poj 1195 Mobile phones(二维BIT裸题)
Description Suppose that the fourth generation mobile phone base stations in the Tampere area operat ...
- java数组实现买彩票(通过标识符进行判断的思想)
package com.wh.shuzu; import java.util.Random; import java.util.Scanner; /** * 买彩票 * @author 王拥江同学 * ...