Commit 1d858546 authored by lujunye's avatar lujunye

调整工作中心显示样式

parent 6cbb8b2f
...@@ -10,6 +10,7 @@ import UIKit ...@@ -10,6 +10,7 @@ import UIKit
class WorkItemCollectionViewCell: UICollectionViewCell { class WorkItemCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var btm_margin: NSLayoutConstraint!
@IBOutlet weak var countLbl: UILabel! @IBOutlet weak var countLbl: UILabel!
@IBOutlet weak var itemNameLbl: UILabel! @IBOutlet weak var itemNameLbl: UILabel!
@IBOutlet weak var itemImgV: UIImageView! @IBOutlet weak var itemImgV: UIImageView!
...@@ -18,6 +19,14 @@ class WorkItemCollectionViewCell: UICollectionViewCell { ...@@ -18,6 +19,14 @@ class WorkItemCollectionViewCell: UICollectionViewCell {
super.awakeFromNib() super.awakeFromNib()
// Initialization code // Initialization code
} }
override func layoutSubviews() {
super.layoutSubviews()
if itemNameLbl.text!.count > 5 {
btm_margin.constant = 0
}else{
btm_margin.constant = 9
}
}
} }
...@@ -12,23 +12,23 @@ ...@@ -12,23 +12,23 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="WorkItemCollectionViewCell" customModule="TestClass" customModuleProvider="target"> <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="WorkItemCollectionViewCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="100" height="89"/> <rect key="frame" x="0.0" y="0.0" width="100" height="91"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="100" height="89"/> <rect key="frame" x="0.0" y="0.0" width="100" height="91"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="pg3-lh-kp9"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="pg3-lh-kp9">
<rect key="frame" x="0.0" y="0.0" width="100" height="89"/> <rect key="frame" x="0.0" y="0.0" width="100" height="91"/>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="item名称" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nZJ-9s-cJg"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="item名称" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nZJ-9s-cJg">
<rect key="frame" x="0.0" y="68.5" width="100" height="13.5"/> <rect key="frame" x="0.0" y="77.5" width="100" height="13.5"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/> <fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bianji" translatesAutoresizingMaskIntoConstraints="NO" id="qfI-0k-kQG"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bianji" translatesAutoresizingMaskIntoConstraints="NO" id="qfI-0k-kQG">
<rect key="frame" x="27.5" y="7.5" width="45" height="45"/> <rect key="frame" x="27.5" y="8.5" width="45" height="45"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="45" id="AKt-O2-9tI"/> <constraint firstAttribute="width" constant="45" id="AKt-O2-9tI"/>
<constraint firstAttribute="height" constant="45" id="mL5-ZO-3vy"/> <constraint firstAttribute="height" constant="45" id="mL5-ZO-3vy"/>
...@@ -65,16 +65,17 @@ ...@@ -65,16 +65,17 @@
<constraint firstAttribute="trailing" secondItem="Ajc-oX-hvc" secondAttribute="trailing" constant="10" id="gtC-oh-x4F"/> <constraint firstAttribute="trailing" secondItem="Ajc-oX-hvc" secondAttribute="trailing" constant="10" id="gtC-oh-x4F"/>
<constraint firstItem="Ajc-oX-hvc" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="mj6-Gx-BZH"/> <constraint firstItem="Ajc-oX-hvc" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="mj6-Gx-BZH"/>
<constraint firstItem="pg3-lh-kp9" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="skh-sW-fEO"/> <constraint firstItem="pg3-lh-kp9" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="skh-sW-fEO"/>
<constraint firstAttribute="bottom" secondItem="nZJ-9s-cJg" secondAttribute="bottom" constant="7" id="v6j-Yr-2wF"/> <constraint firstAttribute="bottom" secondItem="nZJ-9s-cJg" secondAttribute="bottom" id="v6j-Yr-2wF"/>
</constraints> </constraints>
<size key="customSize" width="100" height="82"/> <size key="customSize" width="100" height="82"/>
<connections> <connections>
<outlet property="bgImV" destination="pg3-lh-kp9" id="usC-7f-KnW"/> <outlet property="bgImV" destination="pg3-lh-kp9" id="usC-7f-KnW"/>
<outlet property="btm_margin" destination="v6j-Yr-2wF" id="Acv-4Q-ZBL"/>
<outlet property="countLbl" destination="Ajc-oX-hvc" id="yUr-Ey-VHj"/> <outlet property="countLbl" destination="Ajc-oX-hvc" id="yUr-Ey-VHj"/>
<outlet property="itemImgV" destination="qfI-0k-kQG" id="qLI-Cx-MSh"/> <outlet property="itemImgV" destination="qfI-0k-kQG" id="qLI-Cx-MSh"/>
<outlet property="itemNameLbl" destination="nZJ-9s-cJg" id="D5k-6q-pu9"/> <outlet property="itemNameLbl" destination="nZJ-9s-cJg" id="D5k-6q-pu9"/>
</connections> </connections>
<point key="canvasLocation" x="-18.840579710144929" y="84.375"/> <point key="canvasLocation" x="-18.840579710144929" y="84.040178571428569"/>
</collectionViewCell> </collectionViewCell>
</objects> </objects>
<resources> <resources>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
</imageView> </imageView>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="j1a-a2-V8p"> <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="j1a-a2-V8p">
<rect key="frame" x="0.0" y="114" width="419" height="84"/> <rect key="frame" x="0.0" y="114" width="419" height="84"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="84" id="v8g-As-Pb6"/> <constraint firstAttribute="height" constant="84" id="v8g-As-Pb6"/>
</constraints> </constraints>
...@@ -83,8 +84,8 @@ ...@@ -83,8 +84,8 @@
<constraint firstAttribute="trailing" secondItem="j1a-a2-V8p" secondAttribute="trailing" id="rat-IE-T6s"/> <constraint firstAttribute="trailing" secondItem="j1a-a2-V8p" secondAttribute="trailing" id="rat-IE-T6s"/>
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
<gestureRecognizers/>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<gestureRecognizers/>
<connections> <connections>
<outlet property="cellHeaderHeight" destination="ERR-BB-bri" id="zqE-s5-ybd"/> <outlet property="cellHeaderHeight" destination="ERR-BB-bri" id="zqE-s5-ybd"/>
<outlet property="collectionView" destination="j1a-a2-V8p" id="Tgt-LU-8iy"/> <outlet property="collectionView" destination="j1a-a2-V8p" id="Tgt-LU-8iy"/>
...@@ -107,5 +108,8 @@ ...@@ -107,5 +108,8 @@
<namedColor name="白色背景色"> <namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources> </resources>
</document> </document>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment