Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change the thumb image in UISwitch in ios7?

i need a to change the Thumb image of UISwitch in ios 7, i googled a lot and find nothing..any suggestions or code will be appreciated,below is my required functionality.

enter image description here

enter image description here

i need to change Default UISwitch Thumb image to my Image.

Thanks in Advance.

like image 693
Krishna1251 Avatar asked Jan 20 '14 07:01

Krishna1251


1 Answers

You can do its by a tricky method.

[switchControl setThumbTintColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"Thumb.png"]]];

The Thumb.png should be in correct size. According to me its around 50X50 for retina screen. Note that you can't change the size of switch. That is it can't be bigger that its actual size.

If you want a control that can change its size, you need to create your own control

like image 151
Johnykutty Avatar answered Oct 30 '22 18:10

Johnykutty