Comments (5)
I assume you are using an IBOutlet, the code should be something like this:
#import "ViewController.h"
#import "CRGradientNavigationBar.h"
@interface ViewController ()
@property (nonatomic, weak) IBOutlet CRGradientNavigationBar *navigationBar;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
NSArray *colors = [NSArray arrayWithObjects:(id)[UIColor redColor].CGColor, (id)[UIColor orangeColor].CGColor, nil];
[self.navigationBar setBarTintGradientColors:colors];
}
from crgradientnavigationbar.
Thanks for your answer.
I'm not using an IBOutlet, I'm extending UINavigationController, so self.navigationBar
already exists and already has the class CRGradientNavigationBar
(via Storyboard).
from crgradientnavigationbar.
I have recently started from scratch with code-only and have exactly the same problem.
I copy-pasted the full example from the README
and it only takes the second color (same problem).
And I tried different View- and NavigationControllers but no changes.
Maybe a few words about my environment help:
- iPad App
- Landscape only
- iOS 7.1 (doesn't work with 7.0, either)
When I NSLog the navigationController.navigationBar
, I get this output:
<CRGradientNavigationBar: 0x10972eab0; baseClass = UINavigationBar; frame = (-512 0; 1024 44); autoresize = W; gestureRecognizers = <NSArray: 0x109732c00>; layer = <CALayer: 0x10972e970>>
The thing, that I find really strange is: On any iPhone app it just works (and looks great, btw.).
from crgradientnavigationbar.
Sorry, I didn't have enough time to replicate this bug, I'll look into it, I promise. :)
from crgradientnavigationbar.
Your last comment did not age well, haha. Closing since it's no longer an issue for me.
from crgradientnavigationbar.
Related Issues (12)
- Navigaton Bar for Single Controller HOT 4
- Gradient colors showing as much darker than specified colors HOT 3
- EKEventEditViewController don't work with Gradient
- Double Navigation Bars
- Horizontal gradients? HOT 2
- Modal view HOT 2
- Allow other directions
- Issue later iOS 7.1
- Loose gradient when screen rotate
- Storyboards? HOT 1
- Totally different if set translucent yes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crgradientnavigationbar.