Changing of UISwitch text in iOS 4.2

前端 未结 5 997
名媛妹妹
名媛妹妹 2020-12-11 20:18

I am trying to change the text in UISwitch. The sample from the website ( Changing the text on a UISwitch ) works fine but when I upgrade my xcode to 3.2.5 and iOS 4.2, the

5条回答
  •  我在风中等你
    2020-12-11 21:22

    Try using a customizable open source UISwitch replacement.

    This one seems pretty good: DCRoundSwitch on GitHub, but there are many more on GitHub if that one doesn't work.

    This type of approach doesn't have the same incompatibility issues because it implements the switch's functionality and drawing itself and only relies on the core functionality UIControl base class.  The only thing you might need to update from time to time is the library you're using (DCRoundSwitch), however, base functionality like UIControl and Quartz drawing are quite established and rarely change so this can safely be considered a rare and minimal risk factor.

提交回复
热议问题