3

is it possible to have an image (like an icon) next to a text in UIPickerView ?

I saw examples of UIPickerViews with two Columns :one that has an image and another one with the text . this is not what I need , I need to have a single column with text and Images

Thanks.

DeyaEldeen
  • 10,847
  • 10
  • 42
  • 75
user1051935
  • 579
  • 1
  • 10
  • 29
  • see this question and answer, hope that is what you want [uipickerview image with label][1] [1]: http://stackoverflow.com/questions/4284250/uipickerview-image-with-label-in-component – razibdeb Jul 19 '12 at 10:46

1 Answers1

2

You will need to create your own view for each row of the picker. This is easy enough if it's just a UIImageView and a UILabel. You can then pass the view to your picker using this UIPickerViewDelegate method.

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view

null0pointer
  • 1,533
  • 3
  • 15
  • 29