Alex Rivera | Logout

Change UIPickerView background

Asked 2009-06-08T15:12:39.280
18

I want to change the border color of a UIPickerView. I do not see a tint property for the UIPickerView. Is there any way this could be done? Or a workaround?

Thanks.

Edit
Report

1 Answer

27

You could also mask the component. With a bit fiddeling you can get the size of the component and cut it out with following code:

CALayer* mask = [[CALayer alloc] init];
        [mask setBackgroundColor: [UIColor blackColor].CGColor];
        [mask setFrame:  CGRectMake(10.0f, 10.0f, 260.0f, 196.0f)];
        [mask setCornerRadius: 5.0f];
        [picker.layer setMask: mask];
        [mask release];

Don't forget

#import <QuartzCore/QuartzCore.h>
answered 2012-01-04T15:42:09.163

Your Answer