iphone uipickerview与图像 [英] iphone uipickerview with images
本文介绍了iphone uipickerview与图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在uipickerview中将某些图像/图标而不是文本添加为项目? 谢谢
it's possible add as item in the uipickerview some images/icons instead of text? thanks
推荐答案
是的,这是绝对可能的.您需要处理pickerView委托方法
yes it is absolutely possible. u need to handle pickerView delegate method
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
forComponent:(NSInteger)component reusingView:(UIView *)view
在这里,您只需返回自定义视图(可以是任何UIImage UILabel)
here you simply return custom view(could be anything UIImage UILabel)
并将userInteractionEnable属性设置为no以进行自定义视图.
and set userInteractionEnable property to no for customize view..
这篇关于iphone uipickerview与图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文