Hi, everyone..
I've been trying every day on how to remove the blue highlight in Pickerview. I found nothing useful at Google, but here I found this link:
But, when I try to implement that in my app, nothing happens, the blue highlight selection still appears. If I try to subclass the UILabel using the "didMoveToSuperview"method and return a ""PickerViewLabel" instance in viewForRow, the compiler do not let me to return this type of instance(I declared the @class in the header file). My viewForRow, it's looking like this:
PickerViewLabel *label = (UIView *)view;
label = [[[PickerViewLabel alloc] initWithFrame:frame] autorelease];
CGAffineTransform rotate = CGAffineTransformMakeRotation(-(3.14/2));
rotate = CGAffineTransformScale(rotate, 0.30, 2.5);
if (component == kBraComponent) //kBra is just a #define to indicate the component
{
[label setTransform:rotate];
label.text = [self.bra objectAtIndex:row];
label.font = [UIFont systemFontOfSize:60.0];
label.textAlignment = UITextAlignmentCenter;
label.numberOfLines = 1;
label.lineBreakMode = UILineBreakModeWordWrap;
label.backgroundColor = [UIColor clearColor];
label.clipsToBounds = YES;
return label ;
}
[label setTransform:rotate];
label.text = [self.jap objectAtIndex:row];
label.font = [UIFont systemFontOfSize:50.0];
label.textAlignment = UITextAlignmentCenter;
label.numberOfLines = 1;
label.lineBreakMode = UILineBreakModeWordWrap;
label.backgroundColor = [UIColor clearColor];
label.clipsToBounds = YES;
return label ;
I'm using an horizontal picker with two components and with numbers in the rows. And I will need to use this in other app, but there exists other problem, because it's a horizontal picker with images in the rows, how I return a UILabel instance with an image inside in viewForRow delegate ? If this is impossible I need another way to remove this blue highlight.
Please someone help me, I need something to remove this, doesn't matter what I have in Pickerview, something generic.
note: Sorry if I made mistakes on writing, because I do not speak English fluently.