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

Change Color programmatically for dynamically created gauge. #18

Closed
francisadelante opened this issue Jul 28, 2015 · 7 comments
Closed
Labels

Comments

@francisadelante
Copy link

Hi I am displaying the gauge in CellForRowAtIndexPath and I tried changing the color of gauge depending on its value this is my actual code of doing it

if result! > 0 && result! < 26 {
cell.gauge.startColor = UIColor.redColor()
cell.gauge.endColor = UIColor.redColor()
} else if result! > 25 && result! < 51 {
cell.gauge.startColor = UIColor.orangeColor()
cell.gauge.endColor = UIColor.orangeColor()
} else if result! > 50 && result < 76 {
cell.gauge.startColor = UIColor.yellowColor()
cell.gauge.endColor = UIColor.yellowColor()
} else {
cell.gauge.startColor = UIColor.greenColor()
cell.gauge.endColor = UIColor.greenColor()
}

but it doesn't seem to work it keeps displaying the color i set in mainStoryBoard. The if condition works fine it reads the code in each scenario but it doesn't render the color I need.

@skywinder
Copy link
Owner

Hi. I tried to change color and it works. You can try it by yourself by clonning this repo and switch to branch change-color-test

@skywinder
Copy link
Owner

@francisadelante Ok, got it. It works for GaugeType = Circle But not works for half gauges left and right.

@skywinder skywinder added the bug label Jul 28, 2015
@francisadelante
Copy link
Author

I am using half gauge I forgot to mention.Thanks for quick support.

@skywinder
Copy link
Owner

Fixed in 0.2.4!

@francisadelante
Copy link
Author

I have it use the 0.2.4 version it is now working fine. Thank you so much

@skywinder
Copy link
Owner

You're welcome! :)
Don't forget to put your app on wiki page
https://github.com/skywinder/GaugeKit/wiki/Apps-using-GaugeKit 😉

On Tue, Jul 28, 2015 at 3:19 PM francisadelante notifications@github.com
wrote:

I have it use the 0.2.4 version it is now working fine. Thank you so much


Reply to this email directly or view it on GitHub
#18 (comment).

@francisadelante
Copy link
Author

Sure I will. :)

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

No branches or pull requests

2 participants