Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在文本旁边放置图像(如图标)UIPickerView ?
UIPickerView
我看到UIPickerViews了两列的例子:一个有图像,另一个有文本。这不是我需要的,我需要一个包含文本和图像的列
UIPickerViews
谢谢。
您需要为选择器的每一行创建自己的视图。如果它只是一个 UIImageView 和一个 UILabel,这很容易。然后,您可以使用此 UIPickerViewDelegate 方法将视图传递给您的选择器。
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view