• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Changing UISwitch text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing UISwitch text


  • Subject: Re: Changing UISwitch text
  • From: Roger Dalal <email@hidden>
  • Date: Fri, 29 Apr 2011 19:41:36 -0400

Jon:

UISwitch can not be customized. This question was asked a few weeks ago, and I recommended http://osiris.laya.com/projects/rcswitch/ by Sascha Hoehne and Robert Chin.

If you wish to use a UIButton as a toggle, just change the button's image property to alternating states, as in:

if (condition)
{
         [self.button setImage:offButtonImage forState:UIControlStateNormal];
    condition == NO;
}
else
{
    [self.button setImage:onButtonImage forState:UIControlStateNormal];
    condition == YES;
}

GoodLuck.

Roger Dalal
Assembled Apps


On Apr 29, 2011, at 7:29 PM, Jon Sigman wrote:

> Is there a straightforward way to change the text on the UISwitch ("ON" and
> "OFF") to something else? Alternatively, is there a way for a UIButton to act
> like a toggle (it stays highlighted until touched again)?
> iOS 4.3
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Changing UISwitch text - correction
      • From: Roger Dalal <email@hidden>
    • Re: Changing UISwitch text
      • From: Jon Sigman <email@hidden>
References: 
 >Changing UISwitch text (From: Jon Sigman <email@hidden>)

  • Prev by Date: Re: delete entries in a tableView with the backspace-key on the keyboard
  • Next by Date: Re: Changing UISwitch text
  • Previous by thread: Re: Changing UISwitch text
  • Next by thread: Re: Changing UISwitch text
  • Index(es):
    • Date
    • Thread