Git Product home page Git Product logo

Comments (5)

christianroman avatar christianroman commented on July 29, 2024

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.

bahlo avatar bahlo commented on July 29, 2024

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.

bahlo avatar bahlo commented on July 29, 2024

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.

christianroman avatar christianroman commented on July 29, 2024

Sorry, I didn't have enough time to replicate this bug, I'll look into it, I promise. :)

from crgradientnavigationbar.

bahlo avatar bahlo commented on July 29, 2024

Your last comment did not age well, haha. Closing since it's no longer an issue for me.

from crgradientnavigationbar.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.