IVTEndLiveViewController.m
4.84 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//
// IVTEndLiveViewController.m
// IVTMeLiveTwo
//
// Created by xrg on 16/8/22.
// Copyright © 2016年 QLQ. All rights reserved.
//
#import "IVTEndLiveViewController.h"
#import "IVTHotAndFollowLiveVC.h"
@interface IVTEndLiveViewController ()
{
UILabel *endLive;
UILabel *lookNum;
UILabel *miTang;
UILabel *shortTips;
UIButton *backHome;
}
@end
@implementation IVTEndLiveViewController
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
self.navigationController.navigationBarHidden = YES;
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.navigationController.navigationBarHidden = NO;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self initView];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - 初始化控件
-(void)initView{
__unsafe_unretained typeof (self) wself = self;
// 半透的遮罩
UIImageView *bgImageView = [[UIImageView alloc] initWithFrame:self.view.frame];
bgImageView.backgroundColor = [UIColor blackColor];
bgImageView.alpha = 0.8;
[self.view addSubview:bgImageView];
endLive = [[UILabel alloc]init];
[self.view addSubview:endLive];
endLive.text = @"直播结束";
endLive.textColor = [UIColor IVTLightRedColor];
endLive.font = [UIFont YXFontOfSize:32];
[endLive mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(wself.view);
make.top.equalTo(wself.view).with.offset(130);
}];
lookNum = [[UILabel alloc]init];
[self.view addSubview:lookNum];
lookNum.text = [NSString stringWithFormat:@"%@ 人看过",self.audienceTotle];
lookNum.textColor = [UIColor whiteColor];
lookNum.font = [UIFont YXFontOfSize:18];
[lookNum mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(wself.view);
make.top.equalTo(endLive.mas_bottom).with.offset(23);
}];
// [_lookNum setColor:[UIColor IVTLightRedColor] fromIndex:0 length:self.lookNum.text.length];
miTang = [[UILabel alloc]init];
[self.view addSubview:miTang];
miTang.text = [NSString stringWithFormat:@"收获 %@ 蜜糖",self.mitangTotle];
miTang.textColor = [UIColor whiteColor];
miTang.font = [UIFont YXFontOfSize:18];
[miTang mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(wself.view);
make.top.equalTo(lookNum.mas_bottom).with.offset(11);
}];
shortTips = [[UILabel alloc]init];
[self.view addSubview: shortTips];
// _shortTips.text = @"时长较短的直播不予保存";
shortTips.textColor = [UIColor YXColorWithHexCode:@"#8c8c8c"];
shortTips.font = [UIFont YXFontOfSize:18];
[ shortTips mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(wself.view);
make.top.equalTo(miTang.mas_bottom).with.offset(23);
}];
// 返回首页btn
backHome = [UIButton buttonWithType:UIButtonTypeCustom];
[backHome setBackgroundImage:[UIImage imageNamed:@"返回首页"] forState:UIControlStateNormal];
[backHome setTitle:@"返回首页" forState:UIControlStateNormal];
[backHome setTitleColor:[UIColor IVTLightRedColor] forState:UIControlStateNormal];
backHome.titleLabel.font = [UIFont YXFontOfSize:17];
[self.view addSubview:backHome];
[backHome mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(wself.view.mas_centerX);
make.bottom.equalTo(wself.view.mas_bottom).offset(-145);
make.size.mas_equalTo(CGSizeMake(252, 44));
}];
[backHome addTarget:self action:@selector(backClickFunc:) forControlEvents:UIControlEventTouchUpInside];
UILabel *label = [[UILabel alloc]init];
[self.view addSubview:label];
label.text = @"未抢的红包,将在24小时后退还";
label.textColor = [UIColor whiteColor];
label.font = [UIFont YXFontOfSize:18];
// label.backgroundColor = [UIColor greenColor];
[label mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(wself.view.mas_bottom).offset(-105);
make.centerX.equalTo(wself.view.mas_centerX);
}];
}
//返回首页
-(void)backClickFunc:(UIButton *)button
{
[self dismissViewControllerAnimated:YES completion:^{
}];
[self.navigationController popToRootViewControllerAnimated:YES];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end