views:

37

answers:

1

All I see is a list (which looks like a rolodex), how do I make this like the combo box option?

A: 

I haven't tried this, so I can't say that it will 100% work, but ths is what I would attempt to do:

  1. Extend UIPickerView and initially give it only enough height for one row
  2. In the new class, intercept touchesBegan: so that if the control is in the 1 row mode it will first expand to the full height (using an animation of course). I would probably NOT pass touches on to the super class in this mode
  3. If the control is already in the full height mode, let the touch pass on through to the super class.
  4. Add some other communication with other components on the screen so that when the user touches them, the extended UIPickerView shrinks back to it's 1 line height form, with more animation.

To make all of that work you probably need all your controls in a scroll view that does proper auto layout so that as you change the frame size of the UIPickerView thingie the other controls move around appropriately.

I agree with Henrik that this is very non-Apple however. It seems the prescribed Apple implementation would involve a tableview cell with a disclosure button that takes you to another screen containing the picker. I know the Apple HUI guidelines don't cover all cases, but it seems they probably cover this one.

Tom S.