Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Horizontal gradients? #14

Open
andrewhavens opened this issue Jul 15, 2015 · 2 comments
Open

Horizontal gradients? #14

andrewhavens opened this issue Jul 15, 2015 · 2 comments

Comments

@andrewhavens
Copy link

This library looks like a lifesaver! I need to do something exactly like this (with a translucent gradient), however, I need the gradient to be horizontal, rather than vertical. Is this supported? Or how could I extend this library to support this feature?

@Sean-Wang
Copy link

+1

@yudinm
Copy link

yudinm commented Oct 29, 2015

For horizontal gradient can add startPoint and endPoint like:

- (void)setBarTintGradientColors:(NSArray *)barTintGradientColors
{
    // create the gradient layer
    if (self.gradientLayer == nil) {
        self.gradientLayer = [CAGradientLayer layer];
        self.gradientLayer.opacity = self.translucent ? kDefaultOpacity : 1.0f;
        self.gradientLayer.startPoint = CGPointMake(0.0, 0.5);
        self.gradientLayer.endPoint = CGPointMake(1.0, 0.5);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants