Commit 1d858546 authored by lujunye's avatar lujunye

调整工作中心显示样式

parent 6cbb8b2f
......@@ -10,6 +10,7 @@ import UIKit
class WorkItemCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var btm_margin: NSLayoutConstraint!
@IBOutlet weak var countLbl: UILabel!
@IBOutlet weak var itemNameLbl: UILabel!
@IBOutlet weak var itemImgV: UIImageView!
......@@ -18,6 +19,14 @@ class WorkItemCollectionViewCell: UICollectionViewCell {
super.awakeFromNib()
// 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 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<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">
<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"/>
<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"/>
<subviews>
<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>
<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"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<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>
<constraint firstAttribute="width" constant="45" id="AKt-O2-9tI"/>
<constraint firstAttribute="height" constant="45" id="mL5-ZO-3vy"/>
......@@ -65,16 +65,17 @@
<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="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>
<size key="customSize" width="100" height="82"/>
<connections>
<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="itemImgV" destination="qfI-0k-kQG" id="qLI-Cx-MSh"/>
<outlet property="itemNameLbl" destination="nZJ-9s-cJg" id="D5k-6q-pu9"/>
</connections>
<point key="canvasLocation" x="-18.840579710144929" y="84.375"/>
<point key="canvasLocation" x="-18.840579710144929" y="84.040178571428569"/>
</collectionViewCell>
</objects>
<resources>
......
<?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"/>
<dependencies>
<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="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"/>
</dependencies>
<objects>
......@@ -34,7 +35,7 @@
</imageView>
<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"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="84" id="v8g-As-Pb6"/>
</constraints>
......@@ -83,8 +84,8 @@
<constraint firstAttribute="trailing" secondItem="j1a-a2-V8p" secondAttribute="trailing" id="rat-IE-T6s"/>
</constraints>
</tableViewCellContentView>
<gestureRecognizers/>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<gestureRecognizers/>
<connections>
<outlet property="cellHeaderHeight" destination="ERR-BB-bri" id="zqE-s5-ybd"/>
<outlet property="collectionView" destination="j1a-a2-V8p" id="Tgt-LU-8iy"/>
......@@ -107,5 +108,8 @@
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</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