Why are UISwitch onImage / offImage properties not working on iOS 7?

What is the point of having these two parameters / properties and judging them?

From Apple docs:

offImage The image displayed while the switch is in the off position. @property(nonatomic, retain) UIImage *offImage Discussion In iOS 7, this property has no effect. In iOS 6, this image represents the interior contents of the switch. The image you specify is composited with the switch's rounded bezel and thumb to create the final appearance. Availability Available in iOS 6.0 and later. Declared In UISwitch.h 

What should I do now? Replace all UISwitches with UIButtons?

+1
source share
1 answer

Use the UIButton selected property to use it as a switch. Define images for UIButton UIControlStateSelected and UIControlStateNormal to configure it.

+3
source

Source: https://habr.com/ru/post/1260274/


All Articles