LVCUGCPlayerLoadingView.m
1.28 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
//
// LVCUGCPlayerLoadingView.m
// LiveVideoCloud
//
// Created by cnliveJunBo on 17/3/20.
// Copyright © 2017年 cnlive. All rights reserved.
//
#import "LVCUGCPlayerLoadingView.h"
#import "UIImage+LVCVagueImage.h"
@interface LVCUGCPlayerLoadingView() {
NSString *_bgImageURLStr;
}
@property (nonatomic, strong) UIImageView *bgImageView;
@end
@implementation LVCUGCPlayerLoadingView
- (instancetype)initWithFrame:(CGRect)frame bgImageURLStr:(NSString *)bgImageURLStr
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor whiteColor];
_bgImageURLStr = bgImageURLStr;
[self addSubview:self.bgImageView];
}
return self;
}
- (UIImageView *)bgImageView {
if (!_bgImageView) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"UGCLoading" ofType:@"jpeg"];
UIImage *image = [UIImage imageWithContentsOfFile:path];
UIImage *blurImage = [UIImage boxblurImage:image withBlurNumber:0.6];
_bgImageView = [[UIImageView alloc] initWithImage:blurImage];
_bgImageView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
_bgImageView.clipsToBounds = YES;
}
return _bgImageView;
}
@end