Can we add image together with text in a picker view? Anyone please help!
+1
A:
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.
Vladimir
2010-03-28 13:19:00
A:
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.
sfa
2010-03-30 13:50:56