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

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -