Custom On/Off Image iOS 7.0 UI Switch

不羁的心 提交于 2019-12-18 04:29:13

问题


In iOS 7 switches don't allow custom on/off images by default. While I can still set them in the Interface Builder it doesn't show up.

https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/TransitionGuide.pdf

The transition guide merely notes that it isn't on by default anymore. Presumably there is a way to change that so I do use the images I have.


回答1:


Can you use a UIButton instead, using the "selected" state to mean "on"?




回答2:


Apple never let this feature go live... I believe you can file a bug report about it if you want to see it in the future...

I've got around this issue by using a drop in replacement called SevenSwitch.




回答3:


Download these two files:

SevenSwitch.h 
SevenSwitch.m

Include them to your project, it is very easy for customizing.



来源:https://stackoverflow.com/questions/19410300/custom-on-off-image-ios-7-0-ui-switch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!