-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMCButton.m
More file actions
35 lines (29 loc) · 746 Bytes
/
MCButton.m
File metadata and controls
35 lines (29 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// MCButton.m
// MyView
//
// Created by ike on 2017/3/18.
// Copyright © 2017年 ike. All rights reserved.
//
#import "MCButton.h"
@implementation MCButton
- (void)drawRect:(CGRect)rect {
if (self.cornerRadius !=0 ) {
self.layer.masksToBounds = YES;
self.layer.cornerRadius = self.cornerRadius;
} else {
self.layer.masksToBounds = NO;
self.layer.cornerRadius = 0;
}
if (self.boardWith != 0) {
self.layer.borderWidth = self.boardWith;
} else {
self.layer.borderWidth = 0;
}
if (self.boardColor) {
self.layer.borderColor = self.boardColor.CGColor;
} else {
self.layer.borderColor = [UIColor lightGrayColor].CGColor;
}
}
@end