瀏覽代碼

1.修改Cam Scan,初始化失败时增加提示消息。

Pen Li 9 年之前
父節點
當前提交
422bafde0f
共有 2 個文件被更改,包括 9 次插入3 次删除
  1. 7 1
      common/ScannerViewController.m
  2. 2 2
      common/cam_scan.storyboard

+ 7 - 1
common/ScannerViewController.m

@@ -230,7 +230,13 @@
         [session addInput:input];
         
     } else {
-        DebugLog(@"error: %@", error);
+        __weak typeof(self) weakself = self;
+        UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Warning" message:@"Please goto setting -> privacy -> camera enable RA Image" preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *action = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            [weakself dismissViewControllerAnimated:YES completion:nil];
+        }];
+        [alert addAction:action];
+        [self presentViewController:alert animated:YES completion:nil];
         return;
     }
     

+ 2 - 2
common/cam_scan.storyboard

@@ -88,7 +88,7 @@
                                         </constraints>
                                     </imageView>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="wordWrap" translatesAutoresizingMaskIntoConstraints="NO" id="V66-PS-hiP" userLabel="Button scan">
-                                        <rect key="frame" x="648" y="824" width="100" height="100"/>
+                                        <rect key="frame" x="648" y="844" width="100" height="100"/>
                                         <color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="100" id="NqQ-6g-9PW"/>
@@ -114,7 +114,7 @@
                                     <constraint firstAttribute="trailing" secondItem="V66-PS-hiP" secondAttribute="trailing" constant="20" id="aGy-Ut-mhz"/>
                                     <constraint firstItem="AWN-OI-m1R" firstAttribute="centerX" secondItem="ym0-7Q-YSA" secondAttribute="centerX" id="dnB-Xj-nye"/>
                                     <constraint firstItem="AWN-OI-m1R" firstAttribute="centerY" secondItem="ym0-7Q-YSA" secondAttribute="centerY" id="ijX-CV-tZ4"/>
-                                    <constraint firstAttribute="bottom" secondItem="V66-PS-hiP" secondAttribute="bottom" constant="100" id="rm6-2h-eOb"/>
+                                    <constraint firstAttribute="bottom" secondItem="V66-PS-hiP" secondAttribute="bottom" constant="80" id="rm6-2h-eOb"/>
                                 </constraints>
                             </view>
                         </subviews>