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

1.修改iOS Apex & Drivers在iOS 10设备上TableView偏移值不正确。

Pen Li 8 лет назад
Родитель
Сommit
fda78e67cd

+ 6 - 0
Redant Drivers/Apex And Drivers/Detail/RAOrderDetailViewController.m

@@ -123,6 +123,12 @@
 
 - (void)configureTable {
     
+    if (@available(iOS 11.0, *)) {
+        self.detailTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
+    } else {
+        self.automaticallyAdjustsScrollViewInsets = NO;
+    }
+    
     self.detailTableView.tableFooterView = [UIView new];
     self.detailTableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
     

+ 6 - 0
Redant Drivers/Apex And Drivers/Home/RAHomeViewController.m

@@ -102,6 +102,12 @@
 
 - (void)configureTable {
     
+    if (@available(iOS 11, *)) {
+        self.homeOrderTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
+    } else {
+        self.automaticallyAdjustsScrollViewInsets = NO;
+    }
+    
     self.homeOrderTableView.tableFooterView = [UIView new];
     self.homeOrderTableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
     

+ 8 - 8
Redant Drivers/Apex And Drivers/QRCode/QRCode.storyboard

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
+    <device id="retina5_5" orientation="landscape">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
@@ -16,19 +16,19 @@
             <objects>
                 <viewController storyboardIdentifier="RAQRCodeScannerViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="41J-NQ-wiU" customClass="RAQRCodeScannerViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="aiT-qZ-M5f">
-                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D8z-rA-Qpf">
-                                <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4DJ-GK-9l9">
-                                <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vCI-Zm-N7X">
-                                <rect key="frame" x="70" y="146" width="235" height="235"/>
+                                <rect key="frame" x="121" y="60" width="294" height="294"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <constraints>
                                     <constraint firstAttribute="width" secondItem="vCI-Zm-N7X" secondAttribute="height" multiplier="1:1" id="8cj-iq-wvr"/>
@@ -46,7 +46,7 @@
                                 </variation>
                             </view>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0ig-dn-iSa">
-                                <rect key="frame" x="170" y="567" width="35" height="30"/>
+                                <rect key="frame" x="621" y="192" width="35" height="30"/>
                                 <state key="normal" title="Scan"/>
                                 <connections>
                                     <action selector="scannerBtnTouchCancel:" destination="41J-NQ-wiU" eventType="touchCancel" id="z40-QN-qDW"/>
@@ -58,8 +58,8 @@
                         </subviews>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <constraints>
-                            <constraint firstItem="0ig-dn-iSa" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="vCI-Zm-N7X" secondAttribute="trailing" constant="10" id="29i-AW-HSH"/>
-                            <constraint firstItem="0ig-dn-iSa" firstAttribute="top" relation="greaterThanOrEqual" secondItem="vCI-Zm-N7X" secondAttribute="bottom" constant="10" id="3gR-v0-uuY"/>
+                            <constraint firstItem="0ig-dn-iSa" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="vCI-Zm-N7X" secondAttribute="trailing" priority="999" constant="10" id="29i-AW-HSH"/>
+                            <constraint firstItem="0ig-dn-iSa" firstAttribute="top" relation="greaterThanOrEqual" secondItem="vCI-Zm-N7X" secondAttribute="bottom" priority="999" constant="10" id="3gR-v0-uuY"/>
                             <constraint firstItem="4DJ-GK-9l9" firstAttribute="height" secondItem="D8z-rA-Qpf" secondAttribute="height" id="4QJ-Tu-9cj"/>
                             <constraint firstAttribute="bottom" secondItem="vCI-Zm-N7X" secondAttribute="bottom" constant="81" id="7a1-vL-ZwM"/>
                             <constraint firstAttribute="trailing" secondItem="0ig-dn-iSa" secondAttribute="trailing" constant="104" id="7eW-A7-Nkb"/>

+ 6 - 0
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController.m

@@ -135,6 +135,12 @@
 
 - (void)configureTable {
     
+    if (@available(iOS 11.0, *)) {
+        self.orderEditTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
+    } else {
+        self.automaticallyAdjustsScrollViewInsets = NO;
+    }
+    
     self.orderEditTableView.tableFooterView = [UIView new];
     self.orderEditTableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);