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
//
// ScreeningSecondCollectionReusableView.m
// Lighting
//
// Created by 曹云霄 on 16/5/10.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ScreeningSecondCollectionReusableView.h"
#define WIDTH self.frame.size.width
#define HEIGHT self.frame.size.height
@implementation ScreeningSecondCollectionReusableView
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
[self uiConfigAction];
}
return self;
}
#pragma mark -UI
- (void)uiConfigAction
{
self.alltitleButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.alltitleButton.layer.masksToBounds = YES;
self.alltitleButton.layer.cornerRadius = kCornerRadius;
[self.alltitleButton setTitle:@"全部" forState:UIControlStateNormal];
[self addSubview:self.alltitleButton];
self.alltitleButton.titleLabel.font = [UIFont systemFontOfSize:12];
[self.alltitleButton setTitleColor:kMainBlueColor forState:UIControlStateNormal];
[self.alltitleButton setBackgroundImage:TCImage(@"kamincolor") forState:UIControlStateHighlighted];
[self.alltitleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
self.alltitleButton.layer.masksToBounds = YES;
self.alltitleButton.layer.cornerRadius = kCornerRadius;
self.alltitleButton.layer.borderWidth = 1;
self.alltitleButton.layer.borderColor = kMainBlueColor.CGColor;
[self.alltitleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake((WIDTH-127)/3, 35));
make.right.equalTo(self.mas_right).offset(-30);
make.top.equalTo(self.mas_top).offset(20);
}];
//副标题按钮
self.subTitleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.subTitleButton setTitle:@"副标题" forState:UIControlStateNormal];
[self addSubview:self.subTitleButton];
self.subTitleButton.titleLabel.font = [UIFont systemFontOfSize:12];
[self.subTitleButton setTitleColor:kMainBlueColor forState:UIControlStateNormal];
[self.subTitleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake((WIDTH-127)/3, 35));
make.right.equalTo(self.mas_right).offset(-30);
make.top.equalTo(self.mas_top).offset(75);
}];
}
@end