Marino Faggiana 6 年之前
父节点
当前提交
3dcf2ad126

+ 5 - 5
iOSClient/Main/Create cloud/NCCreateFormUploadRichdocuments.storyboard

@@ -25,17 +25,17 @@
                                     <constraint firstAttribute="height" constant="250" id="XAH-EC-bwE"/>
                                 </constraints>
                                 <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="pay-52-Gt0">
-                                    <size key="itemSize" width="150" height="165"/>
+                                    <size key="itemSize" width="150" height="170"/>
                                     <size key="headerReferenceSize" width="0.0" height="0.0"/>
                                     <size key="footerReferenceSize" width="0.0" height="0.0"/>
                                     <inset key="sectionInset" minX="10" minY="10" maxX="9" maxY="0.0"/>
                                 </collectionViewFlowLayout>
                                 <cells>
                                     <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="3Zg-hF-dVr">
-                                        <rect key="frame" x="10" y="10" width="150" height="165"/>
+                                        <rect key="frame" x="10" y="10" width="150" height="170"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                                            <rect key="frame" x="0.0" y="0.0" width="150" height="165"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="150" height="170"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <imageView opaque="NO" userInteractionEnabled="NO" tag="100" contentMode="scaleAspectFit" translatesAutoresizingMaskIntoConstraints="NO" id="X31-eH-dH5" userLabel="ImagePreview">
@@ -43,10 +43,10 @@
                                                     <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                 </imageView>
                                                 <label opaque="NO" userInteractionEnabled="NO" tag="200" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BeG-go-HP6">
-                                                    <rect key="frame" x="0.0" y="150" width="150" height="15"/>
+                                                    <rect key="frame" x="0.0" y="150" width="150" height="20"/>
                                                     <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                     <constraints>
-                                                        <constraint firstAttribute="height" constant="15" id="SB5-4E-7OZ"/>
+                                                        <constraint firstAttribute="height" constant="20" id="SB5-4E-7OZ"/>
                                                     </constraints>
                                                     <fontDescription key="fontDescription" type="system" pointSize="13"/>
                                                     <nil key="textColor"/>

+ 8 - 6
iOSClient/Main/Create cloud/NCCreateFormUploadRichdocuments.swift

@@ -35,11 +35,16 @@ class NCCreateFormUploadRichdocuments: XLFormViewController, NCSelectDelegate, U
     var listOfTemplate = [NCRichDocumentTemplate]()
     var selectTemplate: NCRichDocumentTemplate?
     
-    let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    
     @IBOutlet weak var collectionView: UICollectionView!
     @IBOutlet weak var collectionViewHeigth: NSLayoutConstraint!
 
+    // Layout
+    let numItems = 2
+    let sectionInsets: CGFloat = 10
+    let highLabelName: CGFloat = 20
+    
+    let appDelegate = UIApplication.shared.delegate as! AppDelegate
+
     // MARK: - View Life Cycle
     
     override func viewDidLoad() {
@@ -128,11 +133,8 @@ class NCCreateFormUploadRichdocuments: XLFormViewController, NCSelectDelegate, U
     
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
 
-        let numItems = 2
-        let sectionInsets: CGFloat = 10
-        
         let itemWidth: CGFloat = (collectionView.frame.width - (sectionInsets * 4) - CGFloat(numItems)) / CGFloat(numItems)
-        let itemHeight: CGFloat = itemWidth + 15
+        let itemHeight: CGFloat = itemWidth + highLabelName
         
         collectionViewHeigth.constant = itemHeight + sectionInsets