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.
Screen Shot
Requirements
- iOS SDK 7.0 or later
- CocoaPods
Installation
Add the following line to your Podfile:
pod "JXGradientNavigationBar"
Usage
-
Import the header file:
#import "JXGradientNavigationBar.h"
-
Set the gradient colors using UIAppearance
barTintGradientColors
property:[JXGradientNavigationBar appearance].barTintGradientColors = @[[UIColor greenColor], [UIColor yellowColor]];
-
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" }
Fri, 04 Mar 2016 13:54:04 +0000