UIPickerView行图像选择高亮颜色

时间:2022-09-25 16:47:11

I currently have a UIPicker which I load in an image for each row using:

我现在有一个UIPicker,我在图像中为每一行加载它:

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

Unlike the normal behaviour using text in the UIPicker row, when using images I get a background selection colour over the image (blue) and was wondering if there was a way to change this colour or even cancel it (probably setting the colour to clearColor). I've tried using highlightedImage on the imageView i'm returning but this didn't work.

与使用UIPicker行中的文本的正常行为不同,当使用图像时,我在图像上获得了背景选择颜色(蓝色),我想知道是否有办法改变这种颜色,或者甚至取消它(可能将颜色设置为clearColor)。我尝试过在返回的imageView中使用highlightedImage,但是这个方法不起作用。

Thanks

谢谢

2 个解决方案

#1


7  

Have you tried to turn off the selection bar by doing...

你是否试图通过…来关闭选择栏?

pickerView.showsSelectionIndicator = NO;

#2


0  

http://developer.apple.com/library/ios/#samplecode/UICatalog/Introduction/Intro.html

http://developer.apple.com/library/ios/ samplecode / UICatalog /介绍/ Intro.html

check this site which will guide ways to create custom picker... its possible to make change in color using custom creation

检查这个网站将指导创建自定义选择器的方法…使用自定义创建更改颜色是可能的

#1


7  

Have you tried to turn off the selection bar by doing...

你是否试图通过…来关闭选择栏?

pickerView.showsSelectionIndicator = NO;

#2


0  

http://developer.apple.com/library/ios/#samplecode/UICatalog/Introduction/Intro.html

http://developer.apple.com/library/ios/ samplecode / UICatalog /介绍/ Intro.html

check this site which will guide ways to create custom picker... its possible to make change in color using custom creation

检查这个网站将指导创建自定义选择器的方法…使用自定义创建更改颜色是可能的