ios - XCode Create a Button Toggle that shows one image for On and one for Off with function -


i trying create toggle button in xcode on , off switch toggling incoming text messages. when feature on image designed on. need set image property state button on. when image off. button has image says off.

what best route complete code.

ryan

i use:

//create switch  uiswitch *myswitchbutton; myswitchbutton.frame=cgrectmake(10, 10, 40, 50); [self addsubview:myswitchbutton]; 

then, add images

myswitchbutton.offimage=[uiimage imagenamed:@"off.png"]; myswitchbutton.onimage=[uiimage imagenamed:@"on.png"]; 

where off.png , on.png images custom design


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -