Anywhere there is a UIButton in my app i would like it to have a specific background image. This background image will always be the same.
What i dont want to have to do is call a method on every button that i put into my UI.
Can i do this via a category or something similar?
You can’t change global appearance of your button via simple code (in current SDK).
BUT, You can subclass your
UIButton. For example:And if you want to insert an UIButton instance like:
you have to change
UIButtontoMyButtonDon’t forget about
#import "MyButton.h"in your .m / .h file.EDIT: Where should you make customizations:
Then, somewhere in your viewController:
or: