2

I want to create a custom picker view controller. When user selects the particular data in the picker list, then will displayed the check mark image for selected category. How do i set the custom image as selected the category. I have created a label and displayed the contents are in the custom label. But i want to displayed the images only, when selects the category. I have searched for many docs and sample programs in the google. But i didn't get any clear idea. So please help me out.

see my screen shot

ScreenShot

Thanks.

Pugalmuni
  • 9,350
  • 8
  • 56
  • 97

2 Answers2

1

You should add custom view in picker control using below default method :

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

{

}

Thanks

Mitesh Khatri
  • 3,935
  • 4
  • 44
  • 67
1

I think that using - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view as I have advised you in the chat room won't help you achieve this UI.

I think that you are better use a UITableView with no separators between cells and place an image above the table so that it will look like a picker.

The problem using a regular UIPicker here is that you want the selected row to move.
In the picker the selected row is the one that is located in the center...

Michael Kessler
  • 14,245
  • 13
  • 50
  • 64