在iOS 7中,交换机默认不允许自定义开/关图像.虽然我仍然可以在界面生成器中设置它们但它不会显示.
转换指南仅指出它不再默认打开.据推测,有一种方法可以改变它,所以我确实使用了我的图像.
拥有这两个选项/属性并弃用它们有什么意义?
来自苹果文档:
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
Run Code Online (Sandbox Code Playgroud)
我现在该怎么办?用 UIButtons 替换所有 UISwitches?