All Projects → swordray → JXGradientNavigationBar

swordray / JXGradientNavigationBar

Licence: MIT license
Custom UINavigationBar subclass with gradient colors on iOS.

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to JXGradientNavigationBar

WXNavigationBar
Handle UINavigationBar like WeChat. Simple and easy to use.
Stars: ✭ 116 (+544.44%)
Mutual labels:  uinavigationbar
NXNavigationExtension
🔥 Lightweight, simple, and easy-to-use NavigationBar library.
Stars: ✭ 121 (+572.22%)
Mutual labels:  uinavigationbar
YRNavigationBarPure
Global navigation bar pure transition
Stars: ✭ 69 (+283.33%)
Mutual labels:  uinavigationbar
Zingle
Zingle – An alert will display underneath your UINavigationBar 🎅
Stars: ✭ 109 (+505.56%)
Mutual labels:  uinavigationbar

JXGradientNavigationBar

Custom UINavigationBar subclass with gradient colors on iOS.

Version License Platform

Screen Shot

Screen Shot

Requirements

Installation

Add the following line to your Podfile:

pod "JXGradientNavigationBar"

Usage

  1. Import the header file:
#import "JXGradientNavigationBar.h"
  1. Set the gradient colors using UIAppearance barTintGradientColors property:
[JXGradientNavigationBar appearance].barTintGradientColors = @[[UIColor greenColor], [UIColor yellowColor]];
  1. Customize your navigation controller:
UINavigationController * navigationController = [[UINavigationController alloc] initWithNavigationBarClass:[JXGradientNavigationBar class] toolbarClass:nil];

Example

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

  [JXGradientNavigationBar appearance].barTintGradientColors = @[[UIColor greenColor], [UIColor yellowColor]];
  [JXGradientNavigationBar appearance].shadowImage = [[UIImage alloc] init];
  [JXGradientNavigationBar appearance].tintColor = [UIColor whiteColor];
  [JXGradientNavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};

  UINavigationController * navigationController = [[UINavigationController alloc] initWithNavigationBarClass:[JXGradientNavigationBar class] toolbarClass:nil];
  navigationController.navigationBar.translucent = YES;
  navigationController.viewControllers = @[[[UIViewController alloc] init]];

  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  [self.window setRootViewController:navigationController];
  [self.window makeKeyAndVisible];

  return YES;
}

Sponsors

License

Copyright © 2015 Jianqiu Xiao [email protected] under The MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].