Open mflint opened 11 years ago
The shape containing the gradient "background-color-top/background-color-bottom" does not resize when the button does. Use the normal "background-color" and it will resize.
We need additional code that resizes the gradient layer when the button size changes. We would need to use KVO to catch bounds changes, since we cannot subclass layoutSubviews or setBounds from a category. @JoshJones57, care to take a shot at this change?
@phatmann @JoshJones57 Hey, I'd forgotten I'd raised this issue.
I did a workaround for this, for when I'm targetting iOS6 only. I'll be dropping iOS6 support soon, so I won't need a fix for this.
If I'm the only person affected by this issue, I'd suggest closing with "Won't Fix". (But thank-you both for taking the time to respond!)
Summary
If the title of a button changes (which causes the size of the button to change) then the NUI style is not repainted.
Example 1
Example 2
What I've tried...
I tried to use KVO to watch for changes to the button's "self.titleLabel.text" property, but didn't get very far.
Another option would be to subclass UIButton and override "setTitle:forState:", but meh, subclassing :-/
So I'm stuck. @tombenner I'm happy to code and test any ideas you might have... I'm starting to think there's an easy solution I'm missing :-)