nui
nui copied to clipboard
UIButton is said to support gradient colors, but it doesn't work
When applying this style, the button is transparent. Probably related to #121
@buttonGradientTop: #000000; @buttonGradientBottom: #FFFFFF;
Button { background-color-top: @buttonGradientTop; background-color-bottom: @buttonGradientBottom; }
This is strange, I'm having the same issue - though this was working last week!
Try manually rendering your button, that's working for me - but is pretty annoying. Strangely labels on the same ViewController are rendering fine.
Manually render like this: #import "NUIRenderer.h"
[NUIRender render:myButton];
Unfortunately I have no idea how to fix this in a non-kludgy manner, but this should work in the meantime. Also this has the unfortunate side effect of blowing up the 'image' set on the UIButton, so I ended up throwing a UIImageView on top of my buttons.
Heh, funny, I also thought this was working just a few days ago.. I have installed XCode5, that could have messed up some stuff, but I'm not entirely sure..
Rendering the buttons manually like this would really clutter the code, since we'd need outlets for every button into the source files. I hope to avoid that :-)
Actually, I just tried the autoupdate feature by adding to main.m:
[NUISettings initWithStylesheet:@"Style"];
#ifdef DEBUG
[NUISettings setAutoUpdatePath:kAbsoluteStylePath];
#endif
Still, the style was not applied immediately, but after I saved the style file again (even without any changes) the buttons where updated with the gradient look.. Just thought I'd tell, incase it would help.
Interesting, and somewhat bizarre. I also thought that Xcode 5 might be the culprit, though I'm not sure how/why it would affect things as I'm using Xcode 4.6.2 to build this project!
My major concern with this fix is, will it work for a release build?
Also I can't get it refreshing at all - maybe it isn't handling spaces in the file path cleanly for some reason. I'll have to dig into it.
It's been a while, but I think I solved this by opening preferences and fixing the location for the command line tools to point to XCode 4.6. Installing XCode 5 had messed with this setting for XCode 4.