radio button control

Discussion in 'iPhone/iPad Programming' started by chhoda, Dec 1, 2008.

  1. macrumors 6502

    Joined:
    Oct 25, 2008
    #1
    Do we have a radio button control kinda thing in iphone ? I want to save space by just showing selected item ... secondly, UIPicker shows all the items, and it has a disgusting background gray colour which does not go at any codt ... !

    regards
    ch
     
  2. macrumors 65816

    Joined:
    Jun 29, 2007
    #2
    There is no radio button but you could easily create one yourself. Lookup how to subclass a UIButton and with some simple programming you can create a UIRadioButton.
     
  3. thread starter macrumors 6502

    Joined:
    Oct 25, 2008
    #3
    combo box

    what about combo box ?
     
  4. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    No combo box either. Please consult the iPhone Application Programming Guide and especially the iPhone Human Interface Guidelines documents for more information on what standard controls are at your disposal.
     
  5. thread starter macrumors 6502

    Joined:
    Oct 25, 2008
    #5
    thanks

    What would be the ideal control for selecting only one value at a time from a number of values and displaying only that item on the screen ?

    ch
     
  6. macrumors regular

    xsmasher

    Joined:
    Jul 18, 2008
    #6
    If it's a small number (3-8 items, maybe?) then UISegmentedControl is a good replacement for radio buttons. It looks like this:
    http://homepage.mac.com/charlesclloyd/Images/UISegmentedControlStyleBar.png

    For a larger number of items that won't fit on one line, UIPickerView is better. It's more similar to a drop-down menu, though.
     
  7. macrumors regular

    Joined:
    Mar 24, 2008
    #7
    UISegmentControl
     
  8. thread starter macrumors 6502

    Joined:
    Oct 25, 2008
    #8
    dynamic and part view ?

    Thanks a ton,

    But can i dynamically add items to UISegmentControl ? Can I have scroll facility on it ? like total 10 items, but only 3 visibale at any given point of time sort of ?

    regards
    ch
     
  9. macrumors regular

    Joined:
    Jun 18, 2008
    #9
    Yes and no.
     
  10. macrumors regular

    xsmasher

    Joined:
    Jul 18, 2008
    #10
    If you have that many options, a UIPickerView sounds more appropriate. You define the number of rows and columns; it looks like the bottom control in this screenshot:
    [​IMG]
     

Share This Page