문제

Whats the point of having these two options/properties and deprecate 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?

도움이 되었습니까?

해결책

Use UIButton's selected property to use it as a switch. Set images for UIButton's UIControlStateSelected and UIControlStateNormal to customise it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top