ScreeningSecondCollectionReusableView.m 2.31 KB
Newer Older
曹云霄's avatar
曹云霄 committed
1 2 3 4 5 6 7 8 9 10 11 12
//
//  ScreeningSecondCollectionReusableView.m
//  Lighting
//
//  Created by 曹云霄 on 16/5/10.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "ScreeningSecondCollectionReusableView.h"


#define WIDTH self.frame.size.width
13
#define HEIGHT self.frame.size.height
曹云霄's avatar
曹云霄 committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
@implementation ScreeningSecondCollectionReusableView



- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self uiConfigAction];
    }
    return self;
}


#pragma mark -UI
- (void)uiConfigAction
{
31
    
32
    self.alltitleButton = [UIButton buttonWithType:UIButtonTypeCustom];
曹云霄's avatar
曹云霄 committed
33 34 35 36 37
    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];
38 39 40 41 42 43 44
    [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;
曹云霄's avatar
曹云霄 committed
45 46 47 48 49 50 51
    [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);
    }];
    
52
    //副标题按钮
53
    self.subTitleButton = [UIButton buttonWithType:UIButtonTypeCustom];
54 55 56 57 58
    [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) {
59

60 61 62 63 64
        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);
    }];
    
曹云霄's avatar
曹云霄 committed
65 66
}

67 68


69 70


曹云霄's avatar
曹云霄 committed
71
@end