UISegmented Control question

Discussion in 'iOS Development' started by Chicken, Sep 7, 2009.

  1. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Is there a way I can make it so that you can select more than one segment on a UISegmentedControl? Seeing as there is no actual option, I'm guessing I'll have to overide one (or some) of it's methods.

    Thanks, Chicken

    Please Register or Log in to view images

  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    No. Not only can you not do this, it is highly unadvisable. The UISegmentedControl is equivalent to a radio button. Being able to select more then one is confusing and most likely sign of poor interface choices. http://en.m.wikipedia.org/wiki/Radio_button?wasRedirected=true


    But, this is what you want to hear: yes. Just override the UISegmentedControl's methods to allow for setting mire than one segment as highlighted. With clever code, you can give the impression of multiple selections when really what you're doing is multiple highlighting.
  3. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    However much I believe that this is the right way to do my interface for this app (It's also been done in a mac app), as to your poor interface choices comment, I'll look for an alternative way I can do it and fall back on this if I cannot find anything.

    Thanks Skylar

    Please Register or Log in to view images

  4. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Just make some custom buttons or something, that change to look selected when tapped.

Share This Page