0

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 in the sourcecode

Martin Huwa
  • 7
  • 3
  • 6

2 Answers2

0

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.

chown
  • 51,908
  • 16
  • 134
  • 170
0

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.

Ahmet Sina Ustem
  • 1,090
  • 15
  • 32
JonasG
  • 9,274
  • 12
  • 59
  • 88