PDA

View Full Version : radio button control




chhoda
Dec 2, 2008, 12:13 AM
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



detz
Dec 2, 2008, 08:34 AM
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.

chhoda
Dec 2, 2008, 11:38 PM
what about combo box ?

dejo
Dec 3, 2008, 12:43 AM
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.

chhoda
Dec 4, 2008, 12:40 AM
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

xsmasher
Dec 5, 2008, 06:08 PM
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

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.

fenrus110
Dec 5, 2008, 06:17 PM
UISegmentControl

chhoda
Dec 8, 2008, 03:10 AM
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

ghayenga
Dec 8, 2008, 09:01 PM
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

Yes and no.

xsmasher
Dec 9, 2008, 01:38 AM
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

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:
http://smasher.com/iphone/WorkoutBuddy/photo-1.jpg