How to create custom UISwitch? [duplicate]

核能气质少年 提交于 2019-12-11 04:46:53

问题


Possible Duplicate:
Changing of UISwitch text in iOS 4.2

Hi, I want to change the text of UISwitch to YES/NO. Is it possible? I have seen some sample codes but nothing seems to work in IOS4.2.Could someone help please?


回答1:


Yes ,you can change the color or text which will be like a UISwitch and can be implemented with the help of a customized UIView class.

you can'nt customize UISwitch.

Inherit UICustomSwitch from UIView.

UICustomSwitch




回答2:


There's a reimplementation of UISwitch in Sam Soffes' SSToolkit: http://cocoacontrols.com/platforms/ios/controls/ssswitch

It lets you change the on/off labels, as well as using an airplane mode style switch.



来源:https://stackoverflow.com/questions/5363541/how-to-create-custom-uiswitch

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