Commit ea44a7d46b175b938685e911a77308e67e74ea2c
1 parent
acfb26f2
no message
Showing
2 changed files
with
14 additions
and
41 deletions
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
| @@ -204,13 +204,22 @@ | @@ -204,13 +204,22 @@ | ||
| 204 | CGRect frame = CGRectMake(0, iPhoneX ? 44 : 0, MainScreenWidth, videoHeight); | 204 | CGRect frame = CGRectMake(0, iPhoneX ? 44 : 0, MainScreenWidth, videoHeight); |
| 205 | UIView *bgView = [[UIView alloc] initWithFrame:frame]; | 205 | UIView *bgView = [[UIView alloc] initWithFrame:frame]; |
| 206 | bgView.backgroundColor = [UIColor blackColor]; | 206 | bgView.backgroundColor = [UIColor blackColor]; |
| 207 | + [self.view addSubview:bgView]; | ||
| 208 | + | ||
| 207 | UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom]; | 209 | UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 208 | backButton.frame = CGRectMake(20, 20, 25, 41); | 210 | backButton.frame = CGRectMake(20, 20, 25, 41); |
| 209 | [backButton setImage:[UIImage imageNamed:@"cnlive_white_back"] forState:UIControlStateNormal]; | 211 | [backButton setImage:[UIImage imageNamed:@"cnlive_white_back"] forState:UIControlStateNormal]; |
| 210 | [backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside]; | 212 | [backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside]; |
| 211 | [bgView addSubview:backButton]; | 213 | [bgView addSubview:backButton]; |
| 212 | - [self.view addSubview:bgView]; | ||
| 213 | - | 214 | + |
| 215 | + //////////////// 分享 //////////////// | ||
| 216 | + UIButton *shareButton = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 217 | + shareButton.frame = CGRectMake(MainScreenWidth-35, 20, 25, 41); | ||
| 218 | + [shareButton setImage:[UIImage imageNamed:@"cnlive_share"] forState:UIControlStateNormal]; | ||
| 219 | + [shareButton addTarget:self action:@selector(shareButton:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 220 | + [bgView addSubview:shareButton]; | ||
| 221 | + //////////////// | ||
| 222 | + | ||
| 214 | if (self.type == PlayerTypeLiving) { | 223 | if (self.type == PlayerTypeLiving) { |
| 215 | // 直播 | 224 | // 直播 |
| 216 | self.liveController = [[CNLivePlayerController alloc] initLivePlayWithChannelId:_dictionary[@"channelId"] activityId:_dictionary[@"activityId"] anchorStatus:YES authSuccess:^{ | 225 | self.liveController = [[CNLivePlayerController alloc] initLivePlayWithChannelId:_dictionary[@"channelId"] activityId:_dictionary[@"activityId"] anchorStatus:YES authSuccess:^{ |
CNLiveScioLive/Pages/Live/View/CNLiveHeaderView.m
| @@ -11,10 +11,8 @@ | @@ -11,10 +11,8 @@ | ||
| 11 | 11 | ||
| 12 | @interface CNLiveHeaderView() | 12 | @interface CNLiveHeaderView() |
| 13 | @property (nonatomic, strong) UIImageView *backgroundImage; | 13 | @property (nonatomic, strong) UIImageView *backgroundImage; |
| 14 | -@property (nonatomic, strong) UILabel *titleLabel; | ||
| 15 | @property (nonatomic, strong) UILabel *stateLabel;//状态 | 14 | @property (nonatomic, strong) UILabel *stateLabel;//状态 |
| 16 | @property (nonatomic, strong) UIButton *playImage;//播放 | 15 | @property (nonatomic, strong) UIButton *playImage;//播放 |
| 17 | -//@property (nonatomic, strong) UILabel *timeLabel;//时间 | ||
| 18 | 16 | ||
| 19 | @end | 17 | @end |
| 20 | 18 | ||
| @@ -39,13 +37,6 @@ | @@ -39,13 +37,6 @@ | ||
| 39 | [_playImage addTarget:self action:@selector(playImageClicked:) forControlEvents:UIControlEventTouchUpInside]; | 37 | [_playImage addTarget:self action:@selector(playImageClicked:) forControlEvents:UIControlEventTouchUpInside]; |
| 40 | [self addSubview:_playImage]; | 38 | [self addSubview:_playImage]; |
| 41 | 39 | ||
| 42 | - _titleLabel = [[UILabel alloc] init]; | ||
| 43 | - _titleLabel.numberOfLines = 1; | ||
| 44 | - _titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 45 | - _titleLabel.textColor = [UIColor whiteColor]; | ||
| 46 | - _titleLabel.font = [UIFont systemFontOfSize:14]; | ||
| 47 | - [self addSubview:_titleLabel]; | ||
| 48 | - | ||
| 49 | _stateLabel = [[UILabel alloc] init]; | 40 | _stateLabel = [[UILabel alloc] init]; |
| 50 | _stateLabel.numberOfLines = 1; | 41 | _stateLabel.numberOfLines = 1; |
| 51 | _stateLabel.lineBreakMode = NSLineBreakByTruncatingTail; | 42 | _stateLabel.lineBreakMode = NSLineBreakByTruncatingTail; |
| @@ -55,13 +46,6 @@ | @@ -55,13 +46,6 @@ | ||
| 55 | _stateLabel.layer.masksToBounds = YES; | 46 | _stateLabel.layer.masksToBounds = YES; |
| 56 | _stateLabel.layer.cornerRadius = 2; | 47 | _stateLabel.layer.cornerRadius = 2; |
| 57 | [self addSubview:_stateLabel]; | 48 | [self addSubview:_stateLabel]; |
| 58 | - | ||
| 59 | -// _timeLabel = [[UILabel alloc] init]; | ||
| 60 | -// _timeLabel.numberOfLines = 1; | ||
| 61 | -// _timeLabel.lineBreakMode = NSLineBreakByTruncatingTail; | ||
| 62 | -// _timeLabel.textColor = [UIColor lightGrayColor]; | ||
| 63 | -// _timeLabel.font = [UIFont systemFontOfSize:12]; | ||
| 64 | -// [self addSubview:_timeLabel]; | ||
| 65 | 49 | ||
| 66 | } | 50 | } |
| 67 | return self; | 51 | return self; |
| @@ -69,8 +53,6 @@ | @@ -69,8 +53,6 @@ | ||
| 69 | } | 53 | } |
| 70 | - (void)setModel:(CNLiveModel *)model{ | 54 | - (void)setModel:(CNLiveModel *)model{ |
| 71 | _model = model; | 55 | _model = model; |
| 72 | - _titleLabel.text = @"最新发布会"; | ||
| 73 | -// _timeLabel.text = model.liveStartDateTime; | ||
| 74 | [_backgroundImage sd_setImageWithURL:[NSURL URLWithString:model.poster] placeholderImage:[UIImage imageNamed:@"cnlive_placeholder"]]; | 56 | [_backgroundImage sd_setImageWithURL:[NSURL URLWithString:model.poster] placeholderImage:[UIImage imageNamed:@"cnlive_placeholder"]]; |
| 75 | switch ([model.status intValue]) { | 57 | switch ([model.status intValue]) { |
| 76 | case 0: { | 58 | case 0: { |
| @@ -152,36 +134,18 @@ | @@ -152,36 +134,18 @@ | ||
| 152 | 134 | ||
| 153 | }]; | 135 | }]; |
| 154 | 136 | ||
| 155 | - [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 156 | - make.left.equalTo(self->_backgroundImage.mas_left).with.offset(10); | ||
| 157 | - make.top.equalTo(self->_backgroundImage.mas_top).with.offset(10); | ||
| 158 | - make.height.offset(18); | ||
| 159 | - | ||
| 160 | - }]; | ||
| 161 | - | ||
| 162 | [_stateLabel mas_makeConstraints:^(MASConstraintMaker *make) { | 137 | [_stateLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
| 163 | - make.right.equalTo(self.mas_right).with.offset(-10); | 138 | + make.left.equalTo(self->_backgroundImage.mas_left).with.offset(10); |
| 164 | make.top.equalTo(self->_backgroundImage.mas_top).with.offset(10); | 139 | make.top.equalTo(self->_backgroundImage.mas_top).with.offset(10); |
| 165 | make.height.offset(18); | 140 | make.height.offset(18); |
| 166 | 141 | ||
| 167 | }]; | 142 | }]; |
| 168 | 143 | ||
| 169 | -// [_stateLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 170 | -// make.left.equalTo(self->_titleLabel.mas_right).with.offset(5); | ||
| 171 | -// make.top.equalTo(self->_backgroundImage.mas_top).with.offset(10); | ||
| 172 | -// make.height.offset(18); | ||
| 173 | -// | ||
| 174 | -// }]; | ||
| 175 | - | ||
| 176 | -// [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 177 | -// make.right.equalTo(self->_backgroundImage.mas_right).with.offset(-10); | ||
| 178 | -// make.top.equalTo(self->_backgroundImage.mas_top).with.offset(10); | ||
| 179 | -// make.height.offset(18); | ||
| 180 | -// | ||
| 181 | -// }]; | ||
| 182 | } | 144 | } |
| 183 | - (void)playImageClicked:(UIButton *)btn{ | 145 | - (void)playImageClicked:(UIButton *)btn{ |
| 184 | self.block?self.block():@""; | 146 | self.block?self.block():@""; |
| 185 | 147 | ||
| 186 | } | 148 | } |
| 149 | + | ||
| 187 | @end | 150 | @end |
| 151 | + |