tombenner/nui

Programmatically rendered NUIButton doesn't seem to inherit classes

Closed this issue · 2 comments

This code:

[NUIRenderer renderButton:doneButton withClass:@"SmallButton"];

doesn't inherit the properties of Button, which I thought was the desired behavior.

I've tried different methods of naming the class using CSS conventions (i.e. Button.SmallButton, Button SmallButton, etc), and also using the class name itself NUISmallButton, but to no avail.

Is there a way to do this, or does this method only work in Interface Builder?

You'll want to use @"Button:SmallButton". Sorry for the confusion there; this is mentioned in another context here, but I'll try to make it more obvious within the NUIRenderer usage documentation soon.

I also might consider adopted a different syntax, now that the stylesheet has become more and more CSS-like (it was a plist previously).

If you could let me know whether the above does indeed work (it should), that'd be great!

That works perfectly. Thanks, Tom.