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.

最新文章

  1. mac终端命令
  2. iPhone与iPad在开发上的区别
  3. 【java】:通用小知识
  4. [javascript svg fill stroke stroke-width x y rect rx ry 属性讲解] svg fill stroke stroke-width rect 绘制具有圆角矩形属性讲解
  5. Jquery ajax调用webservice总结
  6. usb host驱动
  7. Jenkins运行完Test后,把ngreport生成的测试报告 拷贝到相应的文件夹
  8. 详解WPF Blend工具中的复合路径功能 ( 含路径标记语法 )
  9. SQL跨服务器操作语句
  10. 如何删除google流氓扩展(强制安装,并且无权限删除)
  11. 结构体 typedef关键字
  12. css3 文本超出后出现省略号
  13. Random类短时间大量随机重复的问题
  14. HTML5 音频视频
  15. 关于安全性问题:(XSS,csrf,cors,jsonp,同源策略)
  16. Vue.js 基本语法
  17. 20190108C++MFC error 2065 未定义XX原因以及解决方式
  18. “妄”眼欲穿之CSS 居中问题
  19. JavaScript学习 - 基础(三) - 运算符
  20. apiCloud 下拉刷新

热门文章

  1. 【转】解决从jenkins打开robot framework报告会提示‘Opening Robot Framework log failed ’的问题
  2. 1.Ext.onReady详解
  3. window切换Java版本原因
  4. java翻译lua+c+openssl签名项目
  5. [USACO 2012 Feb Gold] Cow Coupons【贪心 堆】
  6. 人工智能-深度学习(3)TensorFlow 实战一:手写图片识别
  7. TSP+Floyd BestCoder Round #52 (div.2) 1002 Victor and Machine
  8. 转-iOS 动画总结----UIView动画
  9. [转]Monkey测试简介
  10. 面相切面编程AOP以及在Unity中的实现