Commit fa6e96f8682378484db60fb7cb02a2c93dd10023
1 parent
005e66a8
删除首页多余view
Showing
3 changed files
with
27 additions
and
17 deletions
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/TopToolView/TopToolView.h
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/HomeViewController.m
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | [UGCLiveListBtn addTarget:self action:@selector(UGCLiveListAction) forControlEvents:UIControlEventTouchUpInside]; |
| 55 | 55 | [self.view addSubview:UGCLiveListBtn]; |
| 56 | 56 | |
| 57 | - _titleArr = @[@"直播",@"推荐",@"频道"]; | |
| 57 | + _titleArr = @[@"直播",@"频道"]; | |
| 58 | 58 | CGFloat width = 0; |
| 59 | 59 | for (NSString *title in _titleArr) { |
| 60 | 60 | CGSize size = [title sizeWithAttributes:@{NSFontAttributeName:self.titleView.elementFont}]; |
| ... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 | [self.view addSubview:self.pageView]; |
| 72 | 72 | [_pageView reloadPages]; |
| 73 | 73 | [_titleView reloadData]; |
| 74 | - [self.titleView scrollToElement:1 animated:NO]; | |
| 74 | + [self.titleView scrollToElement:0 animated:NO]; | |
| 75 | 75 | |
| 76 | 76 | } |
| 77 | 77 | |
| ... | ... | @@ -151,15 +151,7 @@ |
| 151 | 151 | |
| 152 | 152 | - (UIView *)pagingScrollView:(MHPagingScrollView *)pagingScrollView pageForIndex:(NSUInteger)index |
| 153 | 153 | { |
| 154 | - if ([_titleArr[index] isEqualToString:@"推荐"]) { | |
| 155 | - | |
| 156 | - LVCTelevisionView *tvView = (LVCTelevisionView *)[pagingScrollView pageViewByIndex:index]; | |
| 157 | - if (!tvView) { | |
| 158 | - tvView = [[LVCTelevisionView alloc] init]; | |
| 159 | - } | |
| 160 | - return tvView; | |
| 161 | - | |
| 162 | - }else if ([_titleArr[index] isEqualToString:@"频道"]) { | |
| 154 | + if ([_titleArr[index] isEqualToString:@"频道"]) { | |
| 163 | 155 | |
| 164 | 156 | LVCTelevisionView *tvView = (LVCTelevisionView *)[pagingScrollView pageViewByIndex:index]; |
| 165 | 157 | if (!tvView) { | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCLivePlayerController.m
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | #import "CNBarrageView.h" |
| 17 | 17 | #import "chatMsgModel.h" |
| 18 | 18 | |
| 19 | -@interface LVCLivePlayerController ()<LVCPlayerDelegate,LVCInputViewDelegate,LVCChatViewDelegate> | |
| 19 | +@interface LVCLivePlayerController ()<LVCPlayerDelegate,LVCInputViewDelegate,LVCChatViewDelegate,UIGestureRecognizerDelegate> | |
| 20 | 20 | { |
| 21 | 21 | BOOL isHiddenStatusBar; //记录状态的隐藏显示 |
| 22 | 22 | CGRect playerFrame; //播放器原始位置 |
| ... | ... | @@ -35,6 +35,7 @@ |
| 35 | 35 | |
| 36 | 36 | @property (nonatomic, strong) CNBarrageManager *barrageManager; //弹幕管理者 |
| 37 | 37 | @property (nonatomic ,strong) UIView *barrageBaseView; //弹幕总View |
| 38 | +@property (nonatomic, strong) UITapGestureRecognizer *tap; | |
| 38 | 39 | |
| 39 | 40 | @end |
| 40 | 41 | |
| ... | ... | @@ -87,6 +88,10 @@ |
| 87 | 88 | }; |
| 88 | 89 | |
| 89 | 90 | [self.player.contentView addSubview:self.barrageBaseView]; |
| 91 | + | |
| 92 | + _tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)]; | |
| 93 | + _tap.delegate = self; | |
| 94 | + [self.view addGestureRecognizer:self.tap]; | |
| 90 | 95 | |
| 91 | 96 | } |
| 92 | 97 | - (void)addBarrageView:(CNBarrageView *)barrageView { |
| ... | ... | @@ -307,11 +312,6 @@ |
| 307 | 312 | inputView.hidden = YES; |
| 308 | 313 | } |
| 309 | 314 | |
| 310 | -- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event | |
| 311 | -{ | |
| 312 | - [self.view endEditing:YES]; | |
| 313 | -} | |
| 314 | - | |
| 315 | 315 | - (void)removeViews |
| 316 | 316 | { |
| 317 | 317 | [_player removeFromSuperview]; |
| ... | ... | @@ -324,6 +324,23 @@ |
| 324 | 324 | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | +- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event | |
| 328 | +{ | |
| 329 | + [self.view endEditing:YES]; | |
| 330 | +} | |
| 331 | + | |
| 332 | +- (void)dismissKeyboard | |
| 333 | +{ | |
| 334 | + [self.view endEditing:YES]; | |
| 335 | +} | |
| 336 | + | |
| 337 | +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { | |
| 338 | + if ([NSStringFromClass([touch.view class]) isEqualToString:@"LVCChatView"]) { | |
| 339 | + return NO; | |
| 340 | + } | |
| 341 | + return YES; | |
| 342 | +} | |
| 343 | + | |
| 327 | 344 | #pragma mark - |
| 328 | 345 | #pragma mark - makeConstraints |
| 329 | 346 | - (void)makeConstraints | ... | ... |