Skip to content

@steakknife /BackgroundLessPickerView.h
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Backgroundless UIPickerView (works with Autolayout on/off, ios 5/6 (ios7 untested))
//
// BackgroundLessPickerView.h
//
// Created by Barry Allard on 2013-08-27.
// Copyright (c) 2013 Barry Allard All rights reserved.
// License: MIT
#import <UIKit/UIKit.h>
@interface BackgroundLessPickerView : UIPickerView
@end
//
// BackgroundLessPickerView.m
//
// Created by Barry Allard on 2013-08-27.
// Copyright (c) 2013 Barry Allard All rights reserved.
// License: MIT
#import "BackgroundLessPickerView.h"
#import <QuartzCore/QuartzCore.h>
@implementation BackgroundLessPickerView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
}
return self;
}
- (CALayer *)makeMask
{
CALayer* mask = [[CALayer alloc] init];
mask.backgroundColor = [UIColor blackColor].CGColor;
mask.frame = CGRectInset(self.bounds, 10.0f, 10.0f);
mask.cornerRadius = 5.0f;
return mask;
}
- (void)updateMask
{
self.layer.mask = [self makeMask];
}
- (void)layoutSubviews
{
[super layoutSubviews];
[self updateMask];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.