From fdee3e47f4b0c76c1d0b9b8113272159ea2555b1 Mon Sep 17 00:00:00 2001 From: lianxiang <13052344590@163.com> Date: Sat, 8 Sep 2018 09:53:51 +0800 Subject: [PATCH] fix --- GIGA/Category/UINavigationBar+Custom.m | 2 +- GIGA/Common/BaseVC/GiGaBaseViewController.m | 4 ++-- .../Mask/Controller/GiGaFlingCommitVC.m | 22 ++++++++++++------- .../Controller/GiGaMaskTaskViewController.m | 12 +++++----- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/GIGA/Category/UINavigationBar+Custom.m b/GIGA/Category/UINavigationBar+Custom.m index 8b47a96..737a09f 100644 --- a/GIGA/Category/UINavigationBar+Custom.m +++ b/GIGA/Category/UINavigationBar+Custom.m @@ -37,7 +37,7 @@ static char overlayKey; - (void)cnReset { - [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; + [self setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault]; [self.overlay removeFromSuperview]; self.overlay = nil; } diff --git a/GIGA/Common/BaseVC/GiGaBaseViewController.m b/GIGA/Common/BaseVC/GiGaBaseViewController.m index c6b50c3..c7837a1 100644 --- a/GIGA/Common/BaseVC/GiGaBaseViewController.m +++ b/GIGA/Common/BaseVC/GiGaBaseViewController.m @@ -34,12 +34,12 @@ } -(void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; - [self.navigationController.navigationBar setBackgroundImage]; + } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; - + [self.navigationController.navigationBar setBackgroundImage]; } diff --git a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m index e174917..3d3569b 100644 --- a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m +++ b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m @@ -64,11 +64,8 @@ if (nkswitch.isOn) NSLog(@"switchPressed ON"); else - [self.manager disconnectSocket:self.client]; - [self.manager disconnect]; - [self.client disconnect]; - self.client = nil; - self.manager = nil; + [[LXDanMuManager shareInstance] destory]; + [self destorySocket]; [self dismissViewControllerAnimated:YES completion:nil]; NSLog(@"switchPressed OFF"); } @@ -189,8 +186,10 @@ } -(void)maskTimeEnd{ - + // 关闭弹幕 [[LXDanMuManager shareInstance] destory]; + //关闭socket + [self destorySocket]; [self dismissViewControllerAnimated:YES completion:nil]; } @@ -199,8 +198,15 @@ } -(void)dealloc{ - NSLog(@"dealloc"); + NSLog(@"弹幕销毁 聊天关闭"); +} +-(void)destorySocket{ + + [self.manager disconnectSocket:self.client]; + [self.manager disconnect]; + [self.client disconnect]; + self.client = nil; + self.manager = nil; } - @end diff --git a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m index 24edc9d..7bc701b 100644 --- a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m +++ b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m @@ -26,7 +26,7 @@ #import "GiGaFlyingCommitInputView.h" #import "GiGaFlingCommitVC.h" #import "MaskTimeCircularProgressView.h" -#import "UINavigationBar+Custom.h" +//#import "UINavigationBar+Custom.h" @interface GiGaMaskTaskViewController () { @@ -150,7 +150,8 @@ #pragma mark - 生命周期 -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; - + //取消导航对内容下移影响 + [self.navigationController.navigationBar setTranslucent:YES]; } @@ -176,7 +177,7 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. - self.automaticallyAdjustsScrollViewInsets = NO; + [self setUpNav]; [self initUI]; [self addNotify]; @@ -331,7 +332,7 @@ #pragma mark 开始面膜时间 -(void)startMaskTime{ - //[self createInputView]; //出现弹幕 + [self createInputView]; //出现弹幕 AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate]; if (delegate.isMasking) { return; @@ -341,7 +342,7 @@ [self setBackGroundPlayingInfo];//锁屏音频信息 //总时间隔 s - NSTimeInterval timeInterVal = 10; + NSTimeInterval timeInterVal = 30; [self.cicleProgressView startWith:timeInterVal]; //底部弹窗 @@ -500,7 +501,6 @@ [rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn]; - [self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)]; } #pragma mark 消息 action