LVCHeaderRollCollectionViewCell.m
1.09 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
//
// LVCHeaderRollCollectionViewCell.m
// LiveVideoCloud
//
// Created by iOS on 17/3/27.
// Copyright © 2017年 cnlive. All rights reserved.
//
#import "LVCHeaderRollCollectionViewCell.h"
@interface LVCHeaderRollCollectionViewCell ()
@property (nonatomic, strong) UIImageView *imageView;
@end
@implementation LVCHeaderRollCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self.contentView addSubview:self.imageView];
}
return self;
}
#pragma mark -
#pragma mark - setter
- (void)setImageUrl:(NSURL *)imageUrl {
_imageUrl = imageUrl;
[_imageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"load_03"]];
}
#pragma mark -
#pragma mark - gstter
- (UIImageView *)imageView
{
if (!_imageView) {
_imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-20, (SCREEN_WIDTH-20)/2)];
_imageView.backgroundColor = [UIColor whiteColor];
_imageView.contentMode = UIViewContentModeScaleToFill;
}
return _imageView;
}
@end