Просмотр исходного кода

1.修改iOS Apex Mobile Result Field Setting最多允许显示三个。

Pen Li 7 лет назад
Родитель
Сommit
01da529b52

+ 5 - 0
Apex Mobile/Apex Mobile/CustomizeFieldViewController.h

@@ -23,4 +23,9 @@
 @property (strong,nonatomic) NSMutableArray * hidefields;
 @property NSUInteger taptime;
 @property NSIndexPath* lasttap;
+
+// 2019.1.21修改,在Result中显示最多三个
+@property (nonatomic,assign) BOOL forNewResult;
+@property (nonatomic,assign) NSUInteger maxDisplayCount;
+
 @end

+ 21 - 3
Apex Mobile/Apex Mobile/CustomizeFieldViewController.m

@@ -238,10 +238,28 @@
 //    else
 //        return false;
     
-    if (indexPath.section == 0 && [tableView numberOfRowsInSection:indexPath.section] == 1) {
-        return NO;
+    if (self.forNewResult) {
+        
+        // display count
+        NSUInteger displayCount = [tableView numberOfRowsInSection:0];
+        
+        if (displayCount >= self.maxDisplayCount && indexPath.section == 1) {
+            return NO;
+        }
+        
+        if (indexPath.section == 0 && [tableView numberOfRowsInSection:indexPath.section] == 1) {
+            return NO;
+        } else {
+            return YES;
+        }
+        
     } else {
-        return YES;
+        
+        if (indexPath.section == 0 && [tableView numberOfRowsInSection:indexPath.section] == 1) {
+            return NO;
+        } else {
+            return YES;
+        }
     }
 }
 

+ 2 - 0
Apex Mobile/Apex Mobile/Result/ApexResultViewController.m

@@ -277,6 +277,8 @@
                                                     instantiateViewControllerWithIdentifier:@"CustomizeFieldViewController"];
     ViewController.function_name = module_name;
     ViewController.behavior = BEHAVIOR_RESULT;
+    ViewController.forNewResult = YES;
+    ViewController.maxDisplayCount = 3;
     
     [self.navigationController pushViewController:ViewController animated:YES];