Adding image together with text in a picker view

Can we add image together with text in a picker view? Anyone please help!

Answers


In picker view's delegate there is

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

method, where you can create your custom view (may be UIView with UILabel and UIImageView in your case) and return it - so UIPickerView will use it for row representation. See reference for more information.

If you return UIView* in this method you may also need to set its userInteractionEnabled property to NO, otherwise picker will not select rows if you tap them.


The short answer is Yes. You just do the same as you do with UITableView. Creating a custom view to return to the delegate method is all you need to do.


Need Your Help

Android Spinner Selection automatically select item

android spinner

I am updating the spinner at run time. When spinner items comes the first item selects automatically. I do not want, its required only to select the item of item Selected.

Does ng-grid have a right click context menu?

angularjs ng-grid

Does ng-grid provide a right click context menu?