ios4 - UIButton Background Change on click -
can tell me how change uibutton background image?i have customtableview holding 4 buttons.it's quiz app.i want show if ans correct or not loading 2 background image.if correct green image , if wrong red image.
and when question loaded.reset them.it should happen in click.i done loading functionality , logical task of score counting.i need change button background image.can tell me how this?
you should able calling
[button setimage:[uiimage imagenamed:@"green.png"] forstate:uicontrolstatenormal];
or alternatively
[button setbackgroundimage:[uiimage imagenamed:@"green.png"] forstate:uicontrolstatenormal];
documentation reference:
setimage:forstate:
setbackgroundimage:forstate:
Comments
Post a Comment