LVCSectionHeaderCollectionReusableView.m 1.98 KB
//
//  LVCSectionHeaderCollectionReusableView.m
//  LiveVideoCloud
//
//  Created by cnliveJunBo on 17/6/20.
//  Copyright © 2017年 cnlive. All rights reserved.
//

#import "LVCSectionHeaderCollectionReusableView.h"

@interface LVCSectionHeaderCollectionReusableView()

@property (nonatomic, strong)UIButton *button;
@property (nonatomic, strong)UIImageView *arrow;

@end

@implementation LVCSectionHeaderCollectionReusableView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIView *intervalView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 6)];
        intervalView.backgroundColor = [UIColor backgroundColor];
        [self addSubview:intervalView];
        [self addSubview:self.button];
        [self addSubview:self.arrow];
    }
    return self;
}

- (void)setModel:(LVCChannelDetailModel *)model {
    if (_model != model) {
        _model = model;
    }
    [self.button setTitle:[NSString stringWithFormat:@"  %@", model.title] forState:UIControlStateNormal];
}

#pragma mark - ACtion !!!!!!!!!!!!!!!!!!!!!!!!!!
- (void)buttonAction {
    
    NSLog(@"跳转更多!!!!!!!!!!!!!!");
}

#pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!
- (UIButton *)button {
    
    if (!_button) {
        _button = [UIButton buttonWithType:UIButtonTypeCustom];
        _button.frame = CGRectMake(0, 6, self.frame.size.width, 47);
        [_button setTitleColor:[UIColor blackColorCNLive] forState:UIControlStateNormal];
        _button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        [_button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
        _button.titleLabel.font = [UIFont boldSystemFontOfSize:18];
    }
    return _button;
}

- (UIImageView *)arrow {
    
    if (!_arrow) {
        _arrow = [[UIImageView alloc] initWithFrame:CGRectMake(KScreenWidth-5-15, 19, 15, 21)];
        _arrow.image = [UIImage imageNamed:@"gengduo"];
    }
    return _arrow;
}

@end