Quellcode durchsuchen

1.修改iOS Apex Drivers下拉刷新失败后TableView没有回弹。

Pen Li vor 7 Jahren
Ursprung
Commit
97e150dbba

+ 2 - 0
Redant Drivers/Apex And Drivers/BaseViewController/RABaseViewController.h

@@ -16,4 +16,6 @@
 
 - (void)showAlertTilte:(NSString *)title message:(NSString *)msg;
 
+- (void)showAlert:(NSString *)msg;
+
 @end

+ 9 - 4
Redant Drivers/Apex And Drivers/BaseViewController/RABaseViewController.m

@@ -7,6 +7,7 @@
 //
 
 #import "RABaseViewController.h"
+#import "UIView+Toast.h"
 
 @interface RABaseViewController ()
 
@@ -37,15 +38,19 @@
     if (title.length == 0 && msg.length == 0) {
         return;
     }
-    
+
     UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
     UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-        
+
     }];
-    
+
     [alertVC addAction:okAction];
-    
+
     [self presentViewController:alertVC animated:YES completion:nil];
 }
 
+- (void)showAlert:(NSString *)msg {
+    [self.view makeToast:msg duration:2.0f position:CSToastPositionCenter];
+}
+
 @end

+ 1 - 3
Redant Drivers/Apex And Drivers/Detail/RAOrderDetailViewController.m

@@ -163,8 +163,6 @@
             [hud dismiss];
             if (weakSelf.refreshControl.isRefreshing) {
                 [weakSelf.refreshControl endRefreshing];
-                
-                weakSelf.detailTableView.contentOffset = CGPointZero;
             }
             
             if (weakSelf) {
@@ -188,7 +186,7 @@
                 } else {
                     // process error
                     NSString *msg = [json objectForKey:@"err_msg"];
-                    [strongSelf showAlertTilte:@"Warning" message:msg];
+                    [strongSelf showAlert:msg];
                 }
             }
             

+ 1 - 3
Redant Drivers/Apex And Drivers/Home/More/RAHomeMoreViewController.m

@@ -151,8 +151,6 @@ typedef enum {
             [hud dismiss];
             if (weakSelf.refreshControl.isRefreshing) {
                 [weakSelf.refreshControl endRefreshing];
-                
-                weakSelf.homeMoreTableView.contentOffset = CGPointZero;
             }
             
             if (weakSelf) {
@@ -189,7 +187,7 @@ typedef enum {
                 } else {
                     // process error
                     NSString *msg = [json objectForKey:@"err_msg"];
-                    [strongSelf showAlertTilte:@"Warning" message:msg];
+                    [strongSelf showAlert:msg];
                 }
             }
             

+ 1 - 3
Redant Drivers/Apex And Drivers/Home/RAHomeViewController.m

@@ -247,8 +247,6 @@
             [hud dismiss];
             if (weakSelf.refreshControl.isRefreshing) {
                 [weakSelf.refreshControl endRefreshing];
-                
-                weakSelf.homeOrderTableView.contentOffset = CGPointZero;
             }
             
             if (weakSelf) {
@@ -294,7 +292,7 @@
                 } else {
                     // process error
                     NSString *msg = [json objectForKey:@"err_msg"];
-                    [strongSelf showAlertTilte:@"Warning" message:msg];
+                    [strongSelf showAlert:msg];
                 }
             }
             

+ 1 - 3
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController.m

@@ -220,8 +220,6 @@
             [hud dismiss];
             if (weakSelf.refreshControl.isRefreshing) {
                 [weakSelf.refreshControl endRefreshing];
-                
-                weakSelf.orderEditTableView.contentOffset = CGPointZero;
             }
             
             if (weakSelf) {
@@ -244,7 +242,7 @@
                 } else {
                     // process error
                     NSString *msg = [json objectForKey:@"err_msg"];
-                    [strongSelf showAlertTilte:@"Warning" message:msg];
+                    [strongSelf showAlert:msg];
                 }
             }