File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ typedef NS_ENUM(NSInteger, BEMAnimationType) {
98
98
*/
99
99
@property (strong , nonatomic ) IBInspectable UIColor *onFillColor;
100
100
101
+ /* * The color of the inside of the box when it is Off.
102
+ */
103
+ @property (strong , nonatomic ) IBInspectable UIColor *offFillColor;
104
+
101
105
/* * The color of the check mark when it is On.
102
106
*/
103
107
@property (strong , nonatomic ) IBInspectable UIColor *onCheckColor;
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ - (void)commonInit {
68
68
_hideBox = NO ;
69
69
_onTintColor = [UIColor colorWithRed: 0 green: 122.0 /255.0 blue: 255 /255 alpha: 1 ];
70
70
_onFillColor = [UIColor clearColor ];
71
+ _offFillColor = [UIColor clearColor ];
71
72
_onCheckColor = [UIColor colorWithRed: 0 green: 122.0 /255.0 blue: 255 /255 alpha: 1 ];
72
73
_tintColor = [UIColor lightGrayColor ];
73
74
_lineWidth = 2.0 ;
@@ -185,6 +186,11 @@ - (void)setOnFillColor:(UIColor *)onFillColor {
185
186
[self reload ];
186
187
}
187
188
189
+ - (void )setOffFillColor : (UIColor *)offFillColor {
190
+ _offFillColor = offFillColor;
191
+ [self reload ];
192
+ }
193
+
188
194
- (void )setOnCheckColor : (UIColor *)onCheckColor {
189
195
_onCheckColor = onCheckColor;
190
196
[self reload ];
@@ -255,10 +261,9 @@ - (void)drawOffBox {
255
261
self.offBoxLayer = [CAShapeLayer layer ];
256
262
self.offBoxLayer .frame = self.bounds ;
257
263
self.offBoxLayer .path = [self .pathManager pathForBox ].CGPath ;
258
- self.offBoxLayer .fillColor = [UIColor clearColor ] .CGColor ;
264
+ self.offBoxLayer .fillColor = self. offFillColor .CGColor ;
259
265
self.offBoxLayer .strokeColor = self.tintColor .CGColor ;
260
266
self.offBoxLayer .lineWidth = self.lineWidth ;
261
-
262
267
self.offBoxLayer .rasterizationScale = 2.0 * [UIScreen mainScreen ].scale ;
263
268
self.offBoxLayer .shouldRasterize = YES ;
264
269
You can’t perform that action at this time.
0 commit comments