ScreeningSecondCollectionReusableView.m 1.93 KB
Newer Older
曹云霄's avatar
曹云霄 committed
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
//
//  ScreeningSecondCollectionReusableView.m
//  Lighting
//
//  Created by 曹云霄 on 16/5/10.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "ScreeningSecondCollectionReusableView.h"


#define WIDTH self.frame.size.width
@implementation ScreeningSecondCollectionReusableView



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


#pragma mark -UI
- (void)uiConfigAction
{
    self.alltitleButton = [UIButton buttonWithType:UIButtonTypeSystem];
    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 setBackgroundColor:kMainBlueColor];
    [self.alltitleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [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);
    }];
    
    
46 47 48 49 50 51 52 53 54 55 56 57 58
    //副标题按钮
    self.subTitleButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [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);
    }];
    
曹云霄's avatar
曹云霄 committed
59 60 61 62
    
}

@end