Change UIPickerView background

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>

Leave a Comment