سؤال

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