iphone - Drawing a custom button -
i drawing custom button:
uibutton *mybutton = [uibutton buttonwithtype:uibuttontypecustom]; mybutton.frame = cgrectmake(10,10,44,70); [mybutton settitlecolor:[uicolor whitecolor] forstate:uicontrolstatenormal]; [mybutton settitle:@"order" forstate:uicontrolstatenormal];
when tapping on button ground color not changing. need use different images normal , selected state? trick here?
yes, need use different images different states:
[mybutton setbackgroundimage:someuiimageref forstate:uicontrolstatenormal]; [mybutton setbackgroundimage:someotheruiimageref forstate:uicontrolstatehighlighted];
Comments
Post a Comment