Latest 0.1.1
Homepage https://github.com/swordray/JXGradientNavigationBar
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit
Authors

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"
  2. Set the gradient colors using UIAppearance barTintGradientColors property:

    [JXGradientNavigationBar appearance].barTintGradientColors = @[[UIColor greenColor], [UIColor yellowColor]];
  3. 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;
}

License

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

Latest podspec

{
    "name": "JXGradientNavigationBar",
    "version": "0.1.1",
    "summary": "Custom UINavigationBar subclass with gradient colors on iOS.",
    "homepage": "https://github.com/swordray/JXGradientNavigationBar",
    "license": "MIT",
    "authors": {
        "Jianqiu Xiao": "[email protected]"
    },
    "source": {
        "git": "https://github.com/swordray/JXGradientNavigationBar.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "JXGradientNavigationBar/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This