Procházet zdrojové kódy

1.tabbar相关优化

huangxiaodong před 1 rokem
rodič
revize
e745843c92

+ 34 - 3
创维盒子/双子星云手机/Base/Controller/BaseViewController.m

@@ -36,10 +36,41 @@
     [self drawBaseView];
 }
 
-- (void)viewDidAppear:(BOOL)animated {
-    [super viewDidAppear:animated];
-    
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
     
+    NSArray*vcArr = self.navigationController.viewControllers;
+    if(vcArr.count > 1){
+        [self hideTabbarFun];
+    }
+    else{
+        [self showTabbarFun];
+    }
+}
+
+//- (void)viewDidAppear:(BOOL)animated {
+//    [super viewDidAppear:animated];
+//    
+//    NSArray*vcArr = self.navigationController.viewControllers;
+//    if(vcArr.count > 1){
+//        [self hideTabbarFun];
+//    }
+//    else{
+//        [self showTabbarFun];
+//    }
+//}
+
+- (void)showTabbarFun
+{
+    // 显示 tab bar
+    self.tabBarController.tabBar.hidden = NO;
+}
+
+- (void)hideTabbarFun
+{
+    // 隐藏 tab bar
+    self.tabBarController.tabBar.hidden = YES;
 }
 
 //- (UIStatusBarStyle)preferredStatusBarStyle {

+ 0 - 2
创维盒子/双子星云手机/NAS/NASViewController.m

@@ -423,13 +423,11 @@
 - (void)viewWillAppear:(BOOL)animated{
     [super viewWillAppear:animated];
     
-    [self showTabbarFun];
 }
 
 - (void)viewWillDisappear:(BOOL)animated{
     [super viewWillDisappear:animated];
     
-    //[self hideTabbarFun];
 }
 
 - (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated

+ 11 - 17
创维盒子/双子星云手机/cloudPhone/cloudPhoneViewController.m

@@ -44,16 +44,24 @@
     
     //设置按钮
     UIButton *setButton = [[UIButton alloc] init];
-    [setButton setBackgroundImage:[UIImage imageNamed:@"cloudPhone_set"] forState:UIControlStateNormal];
+    //[setButton setBackgroundImage:[UIImage imageNamed:@"cloudPhone_set"] forState:UIControlStateNormal];
+    [setButton setImage:[UIImage imageNamed:@"cloudPhone_set"] forState:UIControlStateNormal];
     setButton.tag = 1;
     [setButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:setButton];
+    //setButton.backgroundColor = [UIColor greenColor];
     
     [setButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        
         make.top.mas_equalTo(imageTopY);
         make.right.mas_equalTo(-16);
-        make.width.mas_equalTo(24);
-        make.height.mas_equalTo(24);
+        make.width.mas_equalTo(50);
+        make.height.mas_equalTo(50);
+        
+//        make.top.mas_equalTo(imageTopY);
+//        make.right.mas_equalTo(-16);
+//        make.width.mas_equalTo(24);
+//        make.height.mas_equalTo(24);
     }];
     
     //中间图片
@@ -161,30 +169,16 @@
 - (void)viewWillAppear:(BOOL)animated{
     [super viewWillAppear:animated];
     
-    [self showTabbarFun];
 }
 
 - (void)viewWillDisappear:(BOOL)animated{
     [super viewWillDisappear:animated];
     
-    //[self hideTabbarFun];
 }
 
 - (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated
 {
     [self.navigationController pushViewController:vc animated:animated];
-    [self hideTabbarFun];
 }
 
-- (void)showTabbarFun
-{
-    // 显示 tab bar
-    self.tabBarController.tabBar.hidden = NO;
-}
-
-- (void)hideTabbarFun
-{
-    // 隐藏 tab bar
-    self.tabBarController.tabBar.hidden = YES;
-}
 @end

+ 16 - 15
创维盒子/双子星云手机/mine/mineViewController.m

@@ -11,6 +11,7 @@
 #import "TipsQRCodeForChangeDeviceViewController.h"
 #import "AboutViewController.h"
 #import "clearCacheAlretViewController.h"
+#import "inputPWDViewController.h"
 
 @interface mineViewController ()
 @property(nonatomic,strong)UIButton *netButton;
@@ -118,8 +119,14 @@
     switch (tag)
     {
         case 10:{
-            privacyModeViewController *vc = [privacyModeViewController new];
-            [self pushViewController:vc animated:YES];
+            inputPWDViewController *nextVC = [inputPWDViewController new];
+            nextVC.isCheckPwdType = YES;
+            [self pushViewController:nextVC animated:YES];
+            
+            KWeakSelf
+            nextVC.didInputRightPwdFun = ^{
+                [weakSelf gotoPrivacyModeVCFun];
+            };
         }
             break;
         case 11:{
@@ -164,6 +171,12 @@
     }
 }
 
+#pragma mark 去设置隐私
+- (void)gotoPrivacyModeVCFun
+{
+    privacyModeViewController *nextVC = [[privacyModeViewController alloc] init];
+    [self pushViewController:nextVC animated:YES];
+}
 
 #pragma mark 清理缓存相关
 - (void)clickClearCacheButtonFun
@@ -409,29 +422,17 @@
 {
     [super viewWillAppear:animated];
     [self setDataFun];
-    [self showTabbarFun];
 }
 
 - (void)viewWillDisappear:(BOOL)animated{
     [super viewWillDisappear:animated];
     
-    //[self hideTabbarFun];
 }
 
 - (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated
 {
     [self.navigationController pushViewController:vc animated:animated];
-    [self hideTabbarFun];
-}
-- (void)showTabbarFun
-{
-    // 显示 tab bar
-    self.tabBarController.tabBar.hidden = NO;
+   
 }
 
-- (void)hideTabbarFun
-{
-    // 隐藏 tab bar
-    self.tabBarController.tabBar.hidden = YES;
-}
 @end