-
Notifications
You must be signed in to change notification settings - Fork 0
/
CCSegmentBarConfig.m
76 lines (57 loc) · 1.54 KB
/
CCSegmentBarConfig.m
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// CCSegmentBarConfig.m
// CCSegmentBar
//
// Created by coderchou on 2016/11/26.
// Copyright © 2016年 coderchou. All rights reserved.
//
#import "CCSegmentBarConfig.h"
@implementation CCSegmentBarConfig
+ (instancetype)defaultConfig {
CCSegmentBarConfig *config = [[CCSegmentBarConfig alloc] init];
config.segmentBarBackColor = [UIColor clearColor];
config.itemFont = [UIFont systemFontOfSize:15];
config.itemNormalColor = [UIColor lightGrayColor];
config.itemSelectColor = [UIColor redColor];
config.indicatorColor = [UIColor redColor];
config.indicatorHeight = 2;
config.indicatorExtraW = 10;
return config;
}
- (CCSegmentBarConfig *(^)(UIColor *))itemNC
{
return ^(UIColor *color) {
self.itemNormalColor = color;
return self;
};
}
- (CCSegmentBarConfig *(^)(UIColor *))itemSC
{
return ^(UIColor *color) {
self.itemSelectColor = color;
return self;
};
}
- (CCSegmentBarConfig *(^)(CGFloat))indicatorEW
{
return ^(CGFloat w) {
self.indicatorExtraW = w;
return self;
};
}
//- (CCSegmentBarConfig *(^)(UIColor *))itemNC {
//
// return ^(UIColor *color){
// self.itemNormalColor = color;
// return self;
// };
//
//}
//
//-(CCSegmentBarConfig *(^)(UIColor *))itemSC {
// return ^(UIColor *color){
// self.itemSelectColor = color;
// return self;
// };
//}
@end