问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/10706459/iphone-uipickerview-image-and-text