#import <QuartzCore/QuartzCore.h>
@interface CALayer (BtnBorderColor)
@property(nonatomic, assign) UIColor *borderUIColor;
@end
#import "CALayer+BtnBorderColor.h"
@implementation CALayer (BtnBorderColor)
-(void)setBorderUIColor:(UIColor*)color
{
self.borderColor = color.CGColor;
}
-(UIColor*)borderUIColor
{
return [UIColor colorWithCGColor:self.borderColor];
}
@end
使用
設(shè)置圓角:Key Path:layer.borderWidth Type:Number Value:1
設(shè)置邊框?qū)挾龋篕ey Path:layer.cornerRadius Type:Number Value:8
設(shè)置邊框的顏色:Key Path:layer.borderColor Type:Color Value:自己選