LVCMainHeaderCollectionReusableView.m
1.99 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
70
//
// LVCMainHeaderCollectionReusableView.m
// LiveVideoCloud
//
// Created by cnliveJunBo on 17/6/20.
// Copyright © 2017年 cnlive. All rights reserved.
//
#import "LVCMainHeaderCollectionReusableView.h"
#import "JBBannerView.h"
#import "JBAutoRollTableView.h"
@interface LVCMainHeaderCollectionReusableView()
@property (nonatomic, strong) JBBannerView *bannerView;
@property (nonatomic, strong) JBAutoRollTableView *rollTableView;
@end
@implementation LVCMainHeaderCollectionReusableView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self addSubview:self.bannerView];
[self addSubview:self.rollTableView];
}
return self;
}
- (void)setBanners:(NSArray *)banners {
if (_banners != banners) {
_banners = banners;
}
_bannerView.bannerArray = banners;
}
#pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- (JBBannerView *)bannerView {
if (!_bannerView) {
_bannerView = [[JBBannerView alloc] initWithFrame:CGRectMake(0, 70, self.bounds.size.width, self.bounds.size.width / 2 + 10)];
_bannerView.backgroundColor = [UIColor purpleColor];
}
return _bannerView;
}
- (JBAutoRollTableView *)rollTableView {
if (!_rollTableView) {
_rollTableView = [[JBAutoRollTableView alloc] initWithFrame:CGRectMake(39, 250, KScreenWidth-40-25+6, 36) style:UITableViewStylePlain];
NSMutableArray *arrayM = [[NSMutableArray alloc] init];
ProgramModel *model1 = [[ProgramModel alloc] init];
model1.title = @"嘉华大厦十大富豪榜";
[arrayM addObject:model1];
ProgramModel *model2 = [[ProgramModel alloc] init];
model2.title = @"思考很久案发的感受";
[arrayM addObject:model2];
ProgramModel *model3 = [[ProgramModel alloc] init];
model3.title = @"模拟电路罚款金额虽";
[arrayM addObject:model3];
_rollTableView.news = arrayM;
}
return _rollTableView;
}
@end