Don’t use setAlternateColor: on UISwitch

March 3, 2011 § 1 Comment

According to Apple documentation, it is recommended not to change UISwitch.

By default UISwitch shows a blue button with “ON” label and white button with “OFF” label. API won’t allow you to change the font name, font size, font style, font color, button color on UISwitch.

Even though there are many examples on how to use setAlternateColor: method to change the default UISwitch button from blue color to orange color, this is not recommended. Your app will be rejected if you use it.

The UISwitch class is not customizable.

You would have to build your own custom switch. It is in general difficult to subclass UIControl and reimplement UISwitch. There are other work around approaches to recreate Switch using png images.

About these ads

§ One Response to Don’t use setAlternateColor: on UISwitch

  • Gabriela says:

    In a later comment, I shall explain some of the reasoning behind our choices.

    Tremendous reasoning here. I really enjoy going through your blog posts.
    I have learned a lot from them.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Don’t use setAlternateColor: on UISwitch at Web Builders.

meta

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: