Skip to content

超简单!!! 一行代码设置状态栏、导航栏按钮、标题、颜色、透明度,移动等 WRNavigationBar which allows you to change NavigationBar's appearance dynamically

License

Notifications You must be signed in to change notification settings

Aaron-Fan/WRNavigationBar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

For Swift:https://github.com/wangrui460/WRNavigationBar_swift


Requirements

  • iOS 8+
  • Xcode 8+

Demo

拉钩App首页

导航栏显示渐变色

导航栏显示图片

新浪微博个人中心

qq空间

知乎日报

QQ我的资料页

蚂蚁森林

连续多个界面导航栏透明

自定义导航栏

移动导航栏

Installation

CocoaPods pod 'WRNavigationBar'

手动拖入 将 WRNavigationBar 文件夹拽入项目中,导入头文件:#import "WRNavigationBar.h"

Use


// 一行代码搞定导航栏显示图片
[self wr_setNavBarBackgroundImage:[UIImage imageNamed:@"millcolorGrad"]];
// 一行代码搞定导航栏颜色
[self wr_setNavBarBarTintColor:[UIColor whiteColor]];
// 一行代码搞定导航栏透明度
[self wr_setNavBarBackgroundAlpha:alpha];
// 一行代码搞定导航栏两边按钮颜色
[self wr_setNavBarTintColor:[UIColor whiteColor]];
// 一行代码搞定导航栏上标题颜色
[self wr_setNavBarTitleColor:[UIColor whiteColor]];
// 一行代码搞定状态栏是 default 还是 lightContent
[self wr_setStatusBarStyle:UIStatusBarStyleLightContent];
// 一行代码搞定导航栏底部分割线是否隐藏
[self wr_setNavBarShadowImageHidden:YES];

// 设置导航栏默认的背景颜色
[UIColor wr_setDefaultNavBarBarTintColor:MainNavBarColor];
// 设置导航栏所有按钮的默认颜色
[UIColor wr_setDefaultNavBarTintColor:[UIColor whiteColor]];
// 设置导航栏标题默认颜色
[UIColor wr_setDefaultNavBarTitleColor:[UIColor whiteColor]];
// 统一设置状态栏样式
[UIColor wr_setDefaultStatusBarStyle:UIStatusBarStyleLightContent];
// 如果需要设置导航栏底部分割线隐藏,可以在这里统一设置
[UIColor wr_setDefaultNavBarShadowImageHidden:YES];

More

我的简书: 韦德460

Update

  • 2017.07.26 添加新Demo:拉钩App首页带搜索框的透明导航栏

  • 2017.07.22 添加新Demo:连续多个界面导航栏透明

  • 2017.07.09 解决问题:当一个控制器中包含多个控制器时,导航栏颜色或透明度不正常的问题

  • 2017.07.05 添加新功能:全局设置导航栏显示图片(不建议在非自定义导航栏中使用)

  • 2017.07.02 添加新功能:导航栏可显示图片

  • 2017.06.29 添加新功能:可单独设置每个控制器对应导航栏底部分割线是否隐藏

  • 2017.06.29 解决问题:解决引入WRNavigationBar后,无法设置导航栏标题大小的问题

  • 2017.06.19 解决问题:解决移动导航栏后右滑返回中途取消导致的导航栏错位的问题

  • 2017.06.15 解决问题:解决scrollView正在滑动的时候,点击返回按钮,导航栏颜色变化突兀的问题

  • 2017.06.04 新增Demo:大半夜的开了一个新的分支extern,为了翻译一下swift版本,因为当前swift版本功能已经很全面了,只是一直没时间写oc,最近又有新的需求!

  • 2017.05.16 新增Demo:完成自定义导航栏实现透明渐变等效果

  • 2017.05.12 解决问题:侧滑一点松开透明的导航栏会变不透明

Features

Contact me

License

WRNavigationBar is available under the MIT license. See the LICENSE file for more info.

About

超简单!!! 一行代码设置状态栏、导航栏按钮、标题、颜色、透明度,移动等 WRNavigationBar which allows you to change NavigationBar's appearance dynamically

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.3%
  • Ruby 1.7%