浏览代码

VLCNetworkCell: rework constraints to be more dynamic

Set label leading anchors to image trailing to adjust for different image sizes and set the label trailing anchors to the leading downloadbutton
Carola Nitz 7 年之前
父节点
当前提交
a408a6ce65
共有 1 个文件被更改,包括 44 次插入40 次删除
  1. 44 40
      Resources/VLCNetworkListCell.xib

+ 44 - 40
Resources/VLCNetworkListCell.xib

@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13168.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="landscape">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13147.4"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
+        <capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
+        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -19,7 +21,7 @@
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="4" customClass="VLCNetworkImageView">
-                        <rect key="frame" x="8" y="9" width="50" height="50"/>
+                        <rect key="frame" x="16" y="9" width="50" height="50"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="50" id="4Vq-gO-XLC"/>
                             <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="a8P-bS-TpP"/>
@@ -33,15 +35,15 @@
                             </mask>
                         </variation>
                     </imageView>
-                    <label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="File Title" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="none" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="6">
-                        <rect key="frame" x="67" y="18" width="221" height="17"/>
+                    <label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="File Title" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="none" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6">
+                        <rect key="frame" x="74" y="15" width="190" height="17"/>
                         <color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
                         <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </label>
-                    <label hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Downloading..." textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="none" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="28" customClass="VLCStatusLabel">
-                        <rect key="frame" x="99" y="25" width="122" height="18"/>
+                    <label hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Downloading..." textAlignment="center" lineBreakMode="wordWrap" baselineAdjustment="none" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="28" customClass="VLCStatusLabel">
+                        <rect key="frame" x="112" y="25" width="96" height="18"/>
                         <color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="18" id="Zr1-tM-Pyf"/>
@@ -50,8 +52,19 @@
                         <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </label>
-                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="25">
-                        <rect key="frame" x="288" y="18" width="32" height="32"/>
+                    <label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Subtitle — Subtitle" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7">
+                        <rect key="frame" x="74" y="36" width="190" height="15"/>
+                        <color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                        <color key="textColor" red="0.72000002861022949" green="0.72000002861022949" blue="0.72000002861022949" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </label>
+                    <button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="25">
+                        <rect key="frame" x="272" y="18" width="32" height="32"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="32" id="b2E-BO-ESa"/>
+                            <constraint firstAttribute="height" constant="32" id="jpk-NV-gaJ"/>
+                        </constraints>
                         <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
                         <state key="normal" image="download.png">
                             <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -60,51 +73,42 @@
                         <state key="highlighted">
                             <color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         </state>
+                        <variation key="default">
+                            <mask key="constraints">
+                                <exclude reference="b2E-BO-ESa"/>
+                                <exclude reference="jpk-NV-gaJ"/>
+                            </mask>
+                        </variation>
                         <connections>
                             <action selector="triggerDownload:" destination="3" eventType="touchUpInside" id="26"/>
                         </connections>
                     </button>
-                    <label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Subtitle — Subtitle" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="7">
-                        <rect key="frame" x="67" y="51.5" width="106" height="10.5"/>
+                    <label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="249" text="Folder Title" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="none" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="23">
+                        <rect key="frame" x="74" y="25.5" width="190" height="17"/>
                         <color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                        <color key="textColor" red="0.72000002861022949" green="0.72000002861022949" blue="0.72000002861022949" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                    </label>
-                    <label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Folder Title" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="none" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="23">
-                        <rect key="frame" x="67" y="17" width="221" height="33.5"/>
-                        <color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        <constraints>
-                            <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="221" id="nUO-RN-7eM"/>
-                        </constraints>
                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
                         <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </label>
                 </subviews>
                 <constraints>
-                    <constraint firstItem="23" firstAttribute="top" secondItem="qo4-sr-qnV" secondAttribute="top" constant="17" id="0NX-Pa-f4L"/>
+                    <constraint firstItem="6" firstAttribute="leading" secondItem="4" secondAttribute="trailing" constant="8" id="0DO-SK-odg"/>
                     <constraint firstItem="28" firstAttribute="centerX" secondItem="qo4-sr-qnV" secondAttribute="centerX" id="1or-QE-1fQ"/>
-                    <constraint firstItem="25" firstAttribute="leading" secondItem="23" secondAttribute="trailing" id="5hg-up-g0F"/>
-                    <constraint firstAttribute="bottom" secondItem="7" secondAttribute="bottom" constant="5.5" id="AJa-em-9aW"/>
-                    <constraint firstAttribute="trailing" secondItem="23" secondAttribute="trailing" constant="32" id="B9g-13-iDv"/>
-                    <constraint firstItem="25" firstAttribute="leading" secondItem="6" secondAttribute="trailing" id="BeZ-EG-k0x"/>
-                    <constraint firstItem="4" firstAttribute="leading" secondItem="qo4-sr-qnV" secondAttribute="leading" constant="8" id="ET1-eu-4Er"/>
-                    <constraint firstAttribute="trailing" secondItem="6" secondAttribute="trailing" constant="32" id="GPC-2Y-YdQ"/>
+                    <constraint firstItem="23" firstAttribute="leading" secondItem="7" secondAttribute="leading" id="5Ar-JE-Yqx"/>
+                    <constraint firstItem="6" firstAttribute="leading" secondItem="23" secondAttribute="leading" id="HEc-tB-oLB"/>
                     <constraint firstItem="4" firstAttribute="centerY" secondItem="qo4-sr-qnV" secondAttribute="centerY" id="JxB-lj-rIe"/>
-                    <constraint firstItem="25" firstAttribute="leading" secondItem="qo4-sr-qnV" secondAttribute="leading" priority="750" constant="288" id="Kix-4h-RnT"/>
-                    <constraint firstItem="6" firstAttribute="top" secondItem="qo4-sr-qnV" secondAttribute="top" constant="18" id="M68-qr-nsZ"/>
-                    <constraint firstAttribute="trailing" secondItem="7" secondAttribute="trailing" constant="147" id="PVM-cw-r43"/>
-                    <constraint firstItem="7" firstAttribute="top" secondItem="23" secondAttribute="bottom" constant="1" id="XKs-kM-vei"/>
-                    <constraint firstItem="25" firstAttribute="top" secondItem="qo4-sr-qnV" secondAttribute="top" constant="18" id="bUy-w6-nTA"/>
-                    <constraint firstAttribute="bottom" secondItem="25" secondAttribute="bottom" constant="17.670000000000002" id="blw-rH-gE7"/>
-                    <constraint firstItem="6" firstAttribute="leading" secondItem="4" secondAttribute="trailing" constant="9" id="bmd-Da-cpw"/>
-                    <constraint firstItem="25" firstAttribute="leading" secondItem="28" secondAttribute="trailing" constant="67" id="jCp-YJ-hUy"/>
+                    <constraint firstItem="6" firstAttribute="bottom" secondItem="qo4-sr-qnV" secondAttribute="centerY" constant="-2" id="KkA-rA-D7T"/>
+                    <constraint firstItem="23" firstAttribute="trailing" secondItem="25" secondAttribute="leading" constant="-8" id="NTl-Ne-ar5"/>
+                    <constraint firstItem="7" firstAttribute="bottom" relation="lessThanOrEqual" secondItem="qo4-sr-qnV" secondAttribute="bottomMargin" id="Qo6-Gd-U30"/>
+                    <constraint firstItem="7" firstAttribute="trailing" secondItem="23" secondAttribute="trailing" id="UsP-hO-cib"/>
+                    <constraint firstItem="6" firstAttribute="trailing" secondItem="23" secondAttribute="trailing" id="WvD-3H-DdX"/>
+                    <constraint firstItem="25" firstAttribute="centerY" secondItem="qo4-sr-qnV" secondAttribute="centerY" id="ZOR-bw-X93"/>
+                    <constraint firstItem="6" firstAttribute="top" relation="greaterThanOrEqual" secondItem="qo4-sr-qnV" secondAttribute="topMargin" id="csN-tj-rK0"/>
                     <constraint firstItem="28" firstAttribute="centerY" secondItem="qo4-sr-qnV" secondAttribute="centerY" id="jOz-Wg-wfW"/>
+                    <constraint firstItem="7" firstAttribute="top" secondItem="qo4-sr-qnV" secondAttribute="centerY" constant="2" id="kFU-wc-JfQ"/>
                     <constraint firstItem="23" firstAttribute="centerY" secondItem="qo4-sr-qnV" secondAttribute="centerY" id="nw8-Li-eEV"/>
-                    <constraint firstItem="23" firstAttribute="leading" secondItem="qo4-sr-qnV" secondAttribute="leading" constant="67" id="oSR-4g-P9K"/>
-                    <constraint firstAttribute="trailing" secondItem="25" secondAttribute="trailing" id="tHU-j7-Zom"/>
-                    <constraint firstItem="7" firstAttribute="leading" secondItem="4" secondAttribute="trailing" constant="9" id="wdv-n7-eMf"/>
+                    <constraint firstItem="25" firstAttribute="trailing" secondItem="qo4-sr-qnV" secondAttribute="trailingMargin" id="rSC-hz-6v1"/>
+                    <constraint firstItem="4" firstAttribute="leading" secondItem="qo4-sr-qnV" secondAttribute="leadingMargin" id="zXF-XV-IEW"/>
                 </constraints>
             </tableViewCellContentView>
             <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>