ios - trouble with UIAppearance and UIButton subclassing -


i have custom button, standard uibutton, cagradientlayer added in.

in custom button, have defined 2 properties:

@property (nonatomic, strong) uicolor* topcolor ui_appearance_selector; @property (nonatomic, strong) uicolor* bottomcolor ui_appearance_selector; 

if 2 values set, button draws nice linear gradient. works great.

i put interfacebuilder possible. so, on of these buttons, in ib's "identity inpsector" add in "user defined runtime attributes" these properties. again, works great.

next, thought i'd try using uiappearance proxies. of custom gradient buttons have same colors. there few different. so, figured use appearance-proxy stuff set default colors class, , buttons different, set values in intefacebuilder. fails.

apparently, what's happening it's reading runtime attributes storyboard file first, afterwards values overwritten appearance proxy. wouldn't expect work way, does.

any tips on how accomplish this? or should give on runtime attributes thing?

ok, i've thought this, , guess appearance proxy supposed do. so, solution have 2 classes "myspecialbutton" , "myappearancebutton".

myappearancebutton sub-class of myspecialbutton.

the of "myappearancebutton" controlled appearance proxy calls. if want button isn't controlled way, i'll make "myspecialbutton" , set properties in user defined runtime attributes. should it.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -