LVCSectionHeaderCollectionReusableView.m
1.98 KB
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
//
// 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