1

I need to present a list of items to the user, allowing them to select one of the items. I've tried the UIPickerView, but its rather limited in that it displays a single line of text for each item.

I need to display additional text for each item and am thinking multiple lines for each item might be a good way to do it.

Any suggestions on a control which will provide multiple lines of text for each item in a list and perhaps use different font sizes for each line?

Nerdtron
  • 1,486
  • 19
  • 32

1 Answers1

2

If your UIPickerViewDelegate implements pickerView:viewForRow:forComponent:reusingView: then you can pass a custom view to be shown in the UIPickerView. Using this, you could construct a custom UIView containing the UILabel you want.

bdesham
  • 15,430
  • 13
  • 79
  • 123
  • Looks like that'll do it. Now I need to figure out how to create a view which contains 2 labels one on top of the other and get the size/layout working. I think using 2 labels and stacking them vertically should work and will then give individual font control over the lines which is nice, just not sure how to do the layout yet. My initial attempts don't seem to be working. Any suggestions? – Nerdtron Mar 13 '13 at 19:02
  • 1
    @Nerdtron You should open a new question, and be sure to include the code you’ve already tried :-) – bdesham Mar 13 '13 at 19:08