Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chhoda

macrumors 6502
Original poster
Oct 25, 2008
285
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
 

detz

macrumors 65816
Jun 29, 2007
1,051
0
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.
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
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

macrumors 6502
Original poster
Oct 25, 2008
285
1
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
 

xsmasher

macrumors regular
Jul 18, 2008
140
0
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.
 

chhoda

macrumors 6502
Original poster
Oct 25, 2008
285
1
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
 

ghayenga

macrumors regular
Jun 18, 2008
190
0
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

macrumors regular
Jul 18, 2008
140
0
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:
photo-1.jpg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.