Przeglądaj źródła

1.修改RA Image iOS Mode列表,增加Mode Description描述,并且以富文本形式显示。

Pen Li 8 lat temu
rodzic
commit
b9d6fa6820

BIN
RA Image/RA Image.xcodeproj/project.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 35 - 3
RA Image/RA Image.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -13,6 +13,38 @@
             stopOnStyle = "0">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/upload/RAUploadManager.m"
+            timestampString = "531891980.403576"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "413"
+            endingLineNumber = "413"
+            landmarkName = "-stopTask:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/upload/RAUploadManager.m"
+            timestampString = "531891981.307662"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "417"
+            endingLineNumber = "417"
+            landmarkName = "-stopTask:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -20,11 +52,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "../common/upload/RAUploadOperation.m"
-            timestampString = "531826988.995198"
+            timestampString = "531892009.413002"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "158"
-            endingLineNumber = "158"
+            startingLineNumber = "133"
+            endingLineNumber = "133"
             landmarkName = "-start"
             landmarkType = "7">
          </BreakpointContent>

+ 3 - 0
RA Image/RA Image/RootModeCell.h

@@ -13,5 +13,8 @@
 @property (nonatomic,copy) NSString *mode;
 @property (nonatomic,copy) NSString *code_name;
 @property (nonatomic,assign) BOOL enable;
+@property (nonatomic,copy) NSString *desc;
+
+- (void) setMode:(NSString *)mode desc:(NSString *)desc;
 
 @end

+ 29 - 0
RA Image/RA Image/RootModeCell.m

@@ -36,4 +36,33 @@
     self.modeLabel.enabled = enable;
 }
 
+- (void)setMode:(NSString *)mode desc:(NSString *)desc {
+    _mode = mode;
+    _desc = desc;
+//    _desc = @"dfhajkdhfkajhdklahdfalllllllalalalalaPKOSdididiididdi";
+    self.modeLabel.attributedText = nil;
+    self.modeLabel.text = nil;
+    if (desc == nil || desc.length == 0) {
+        self.modeLabel.text = mode;
+    } else if (mode == nil || mode.length == 0){
+        self.modeLabel.text = mode;
+    } else {
+        NSString *str = [NSString stringWithFormat:@"%@ -- %@",_mode,_desc];
+        NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:str];
+        NSRange redRange = NSMakeRange(_mode.length + 1, str.length - (_mode.length + 1));
+        NSRange normalRange = NSMakeRange(0, _mode.length);
+        NSDictionary *redAttrs = @{
+                                   NSForegroundColorAttributeName : [UIColor redColor],
+                                   NSFontAttributeName : [UIFont systemFontOfSize:15.0f]
+                                   };
+        NSDictionary *normalAttrs = @{
+                                      NSForegroundColorAttributeName : [UIColor blackColor],
+                                      NSFontAttributeName : [UIFont systemFontOfSize:17.0f]
+                                      };
+        [attrStr addAttributes:redAttrs range:redRange];
+        [attrStr addAttributes:normalAttrs range:normalRange];
+        self.modeLabel.attributedText = attrStr;
+    }
+}
+
 @end

+ 3 - 1
RA Image/RA Image/RootViewController.m

@@ -103,7 +103,9 @@ static NSString *kLastMode = @"lastChooseMode";
     RootModeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RootModeCell"];
     NSDictionary *mode = [self.modeList objectAtIndex:indexPath.row];
     NSString *name = [mode objectForKey:@"name"];
-    cell.mode = name;
+    NSString *desc = [mode objectForKey:@"description"];
+//    cell.mode = name;
+    [cell setMode:name desc:desc];
     NSString *codeName = [mode objectForKey:@"code_name"];
     cell.code_name = codeName;