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 导航栏风格的更多相关文章

  1. iOS 屏幕原点坐标 && 导航栏风格的自定义

    其一 屏幕原点坐标 (x ,y) 受 self.navigationController. navigationBar 的 setTranslucent (BOOL) 属性控制 在 iOS7 以后   ...

  2. 转:ios导航栏设置

    原帖:http://www.cocoachina.com/industry/20131104/7287.html 本文提供的代码需要用Xcode 5来执行.如果你还在使用老版本的Xcode,那么在运行 ...

  3. IOS 导航栏属性设置

    IOS 7 以上系统导航栏: [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; // 返回按钮颜色 [UINaviga ...

  4. IOS导航栏的使用方法

    本文是使用纯代码实现一个导航栏的效果.单击按钮并且产生事件.基本思路是: 1.创建一个导航栏(UINavigationBar对象) 2.创建一个导航栏集合(UINavigationItem对象) 3. ...

  5. 保持UIImagePickerController后导航栏风格统一

    1. UIImagePickerController 状态栏始终保持某一种风格. -(void)navigationController:(UINavigationController *)navig ...

  6. 【Swift】iOS导航栏错乱的原因

    #iOS开发高级技巧#导航栏错乱,也就是导航栏的显示效果与内容区不匹配,引发原因很多,其中最重要的有两个原因: 1.在viewwillappear,viewwilldisappear两个函数中,设置导 ...

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

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

  8. iOS 导航栏黑线,UIImage 枚举处理方式

      ios 找出导航栏下面的黑线(可隐藏,改变样式等) http://www.jianshu.com/p/effa4a48f1e3     设置UIImage的渲染模式:UIImage.renderi ...

  9. ios 导航栏的显示和隐藏切换

    从简单的一个没有导航栏的界面A push到另一个有导航栏的界面 B,在界面A的逻辑中加入下面逻辑: 屏幕快照 2016-03-30 上午10.35.24.png 这样完美的处理了这个场景变换需求.引起 ...

随机推荐

  1. MySQL-Tool:Navicate 安装

    ylbtech-MySQL-Tool:Navicate 安装 1.返回顶部 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 2. 激活返回顶部 1. 2. 3. 4. 5. 6. 7. ...

  2. java如何遍历map的所有的元素(各种方法)

    JDK1.4中 Map map = new HashMap(); Iterator it = map.entrySet().iterator(); while (it.hasNext()) { Map ...

  3. 洛谷 P3622 [APIO2007]动物园【状压dp】

    看成网络流建图想了好久... 实际上5个是可以状压的 设f[i][k]为到第i个围栏状态为k的方案数,因为考虑到重复,设g[i][k]记录i开始,状态为k的孩子有几个 状态转移很好想:f[j][k]= ...

  4. bzoj 3589: 动态树【树链剖分+容斥】

    因为一开始调试不知道unsigned怎么输出就没有加\n结果WA了一上午!!!!!然而最后放弃了unsigned选择了&2147483647 首先链剖,因为它所给的链一定是某个点到根的路径上的 ...

  5. Hdu 5361 In Touch (dijkatrs+优先队列)

    题目链接: Hdu 5361  In Touch 题目描述: 有n个传送机排成一排,编号从1到n,每个传送机都可以把自己位置的东西传送到距离自己[l, r]距离的位置,并且花费c,问从1号传送机到其他 ...

  6. Poj 2289 Jamie's Contact Groups (二分+二分图多重匹配)

    题目链接: Poj 2289 Jamie's Contact Groups 题目描述: 给出n个人的名单和每个人可以被分到的组,问将n个人分到m个组内,并且人数最多的组人数要尽量少,问人数最多的组有多 ...

  7. 安装CentOS--设置网络_1

    (1)在登录黑框中输入如下命令,让CentOS 7自动获取一个IP地址: # dhclient (2)正常情况下不会有任何输出内容.用如下命令查看获取到的IP地址: # ip addr 它将返回如图所 ...

  8. Android 更新方案实现

    需求说明 为了保证自己 APP 的新版本使用率,现在有很多已有的“软件更新”框架供各位使用,本文的主要内容是如何自己动手来实现软件的后台下载,更新. 下面详细说明下软件更新的逻辑,流程图如下: 每步详 ...

  9. Android学习笔记(十) Activity的生命周期

    一.如何在一个应用程序中定义多个Activity -定义一个类,继承Activity -复写onCreate() setContentView(R.layout.secondLayout):设定该Ac ...

  10. scala如何在任意方法中打印当前线程栈信息(StackTrace)

    1.以wordcount为例 package org.apache.spark.examples import org.apache.spark.{SparkConf, SparkContext} / ...