Browse Source

Merge branch 'master' of http://101.200.220.49:8001/liuxueli/KDProject

学丽 5 years ago
parent
commit
34707ea4af

BIN
KuDianProject.xcworkspace/xcuserdata/kaipeng.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 2
KuDianProject/Login/controller/KDPPhoneLoginViewController.m

@@ -69,7 +69,6 @@ static int count = 0;
69 69
     phoneField.textColor = [UIColor colorWithHex:0x333333];
70 70
     phoneField.font = FONT_SYS(16);
71 71
     phoneField.placeholder = @"请输入手机号";
72
-    phoneField.clearButtonMode = UITextFieldViewModeWhileEditing;
73 72
     [phoneField addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
74 73
     self.phoneTextField = phoneField;
75 74
     [self.view addSubview:self.phoneTextField];
@@ -93,7 +92,6 @@ static int count = 0;
93 92
     self.codeField.textColor = [UIColor colorWithHex:0x333333];
94 93
     self.codeField.font = FONT_SYS(16);
95 94
     self.codeField.placeholder = @"请输入验证码";
96
-    self.codeField.clearButtonMode = UITextFieldViewModeWhileEditing;
97 95
     [self.view addSubview:self.codeField];
98 96
     
99 97
     UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(32, self.codeField.bottom + 12, SCREEN_WIDTH-64, 1)];

+ 54 - 1
KuDianProject/TOP/Drawer/Control/KDPSetViewController.m

@@ -8,6 +8,7 @@
8 8
 
9 9
 #import "KDPSetViewController.h"
10 10
 #import "KDPPhoneLoginViewController.h"
11
+#import "KDPTabBarVC.h"
11 12
 @interface KDPSetViewController ()<UITableViewDelegate,UITableViewDataSource>
12 13
 {
13 14
     
@@ -121,8 +122,60 @@
121 122
 -(void)exitClickButton
122 123
 {
123 124
     [KDPAccountTool deleteAccount];
124
-     [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:[[UINavigationController alloc]initWithRootViewController:[[KDPPhoneLoginViewController alloc]init]] animated:YES completion:nil];
125
+    
125 126
     [self.navigationController popToRootViewControllerAnimated:YES];
127
+    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:[[UINavigationController alloc]initWithRootViewController:[[KDPPhoneLoginViewController alloc]init]] animated:YES completion:^{
128
+        KDPTabBarVC *tabbar = (KDPTabBarVC *)[UIApplication sharedApplication].keyWindow.rootViewController;
129
+        tabbar.selectedIndex = 0;
130
+    }];
131
+}
132
+
133
+- (UIViewController *)getCurrentVC {
134
+    // Find best view controller
135
+    UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
136
+    return [self findBestViewController:viewController];
137
+}
138
+
139
+-(UIViewController*) findBestViewController:(UIViewController*)vc {
140
+    
141
+    if (vc.presentedViewController) {
142
+        
143
+        // Return presented view controller
144
+        return [self findBestViewController:vc.presentedViewController];
145
+        
146
+    } else if ([vc isKindOfClass:[UISplitViewController class]]) {
147
+        
148
+        // Return right hand side
149
+        UISplitViewController* svc = (UISplitViewController*) vc;
150
+        if (svc.viewControllers.count > 0)
151
+            return [self findBestViewController:svc.viewControllers.lastObject];
152
+        else
153
+            return vc;
154
+        
155
+    } else if ([vc isKindOfClass:[UINavigationController class]]) {
156
+        
157
+        // Return top view
158
+        UINavigationController* svc = (UINavigationController*) vc;
159
+        if (svc.viewControllers.count > 0)
160
+            return [self findBestViewController:svc.topViewController];
161
+        else
162
+            return vc;
163
+        
164
+    } else if ([vc isKindOfClass:[UITabBarController class]]) {
165
+        
166
+        // Return visible view
167
+        UITabBarController* svc = (UITabBarController*) vc;
168
+        if (svc.viewControllers.count > 0)
169
+            return [self findBestViewController:svc.selectedViewController];
170
+        else
171
+            return vc;
172
+        
173
+    } else {
174
+        
175
+        // Unknown view controller type, return last child view controller
176
+        return vc;
177
+        
178
+    }
126 179
 }
127 180
 
128 181
 @end