Add programmatically clickable Button with custom Views layouted in InterfaceBuilder
I have a UIScrollView. In there I add buttons programmatically. Right now I just use UIButton and set one title. Bu开发者_如何转开发t I need to have an UIImage View in there, that will change upon certain events, Text that will change too etc. and I would like to style that in Interface Builder, but I can't figure out how to do this. Which class should I extend, and what kind of xib should I create and what in there, so that in the end I can make the right connections and so that I can listen for UIControlEventTouchDown of that Button.
Just make a UIViewController subclass with a nib. You can do everything you want from there.
精彩评论