开发者

Set text of UISwitch in XCode

How can I set the text of the left and right label of a UISwitch in XCode4 (iOS4) ?

Searched for a solution but need a simple direct solution开发者_如何学Go in the sourcecode


Customizing the switch itself is I think impossible, and if possible only using private APIs, and could cause a lot of problems depending on the firmware. An App Store safe way is using a UISlider.


From UISwitch Reference: The UISwitch class is not customizable.

Use a UISegmentedControl instead with 2 segments and [segControl setMomentary:NO], then use the - (void)setTitle:(NSString *)title forSegmentAtIndex:(NSUInteger)segment method to set the title.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜