Commit a87f57fc by houweibin

适配iphoneX

parent b56408f9
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<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>
<customFonts key="customFonts"> <customFonts key="customFonts">
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
<objects> <objects>
<viewController storyboardIdentifier="KWMBrandCaramelVC" hidesBottomBarWhenPushed="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="eiC-Xl-2es" userLabel="品牌Caramel" customClass="KWMBrandCaramelVC" sceneMemberID="viewController"> <viewController storyboardIdentifier="KWMBrandCaramelVC" hidesBottomBarWhenPushed="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="eiC-Xl-2es" userLabel="品牌Caramel" customClass="KWMBrandCaramelVC" sceneMemberID="viewController">
<layoutGuides> <layoutGuides>
<viewControllerLayoutGuide type="top" id="gML-uH-K3J"/> <viewControllerLayoutGuide type="top" id="6iQ-dc-23W"/>
<viewControllerLayoutGuide type="bottom" id="3n2-hH-xH7"/> <viewControllerLayoutGuide type="bottom" id="HuL-FJ-3YQ"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="zpX-41-Ngk"> <view key="view" contentMode="scaleToFill" id="zpX-41-Ngk">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="IcS-3H-XUB"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="IcS-3H-XUB">
<rect key="frame" x="0.0" y="94" width="375" height="573"/> <rect key="frame" x="0.0" y="94" width="375" height="573"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="0.95686274509803915" green="0.96078431372549022" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<view key="tableHeaderView" clipsSubviews="YES" contentMode="scaleToFill" id="m0g-lT-Bac"> <view key="tableHeaderView" clipsSubviews="YES" contentMode="scaleToFill" id="m0g-lT-Bac">
<rect key="frame" x="0.0" y="0.0" width="375" height="210"/> <rect key="frame" x="0.0" y="0.0" width="375" height="210"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
...@@ -129,23 +129,23 @@ ...@@ -129,23 +129,23 @@
</constraints> </constraints>
</view> </view>
</subviews> </subviews>
<color key="backgroundColor" red="0.95686274509803915" green="0.96078431372549022" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstAttribute="bottom" secondItem="IcS-3H-XUB" secondAttribute="bottom" id="0j4-ln-dzu"/>
<constraint firstItem="hDa-nl-Tlr" firstAttribute="top" secondItem="zpX-41-Ngk" secondAttribute="top" constant="64" id="1ku-fw-1rl"/> <constraint firstItem="hDa-nl-Tlr" firstAttribute="top" secondItem="zpX-41-Ngk" secondAttribute="top" constant="64" id="1ku-fw-1rl"/>
<constraint firstAttribute="trailing" secondItem="evT-5t-rty" secondAttribute="trailing" id="67h-A6-5jJ"/> <constraint firstAttribute="trailing" secondItem="evT-5t-rty" secondAttribute="trailing" id="67h-A6-5jJ"/>
<constraint firstItem="IcS-3H-XUB" firstAttribute="leading" secondItem="zpX-41-Ngk" secondAttribute="leading" id="CIl-uD-o0w"/> <constraint firstItem="IcS-3H-XUB" firstAttribute="leading" secondItem="zpX-41-Ngk" secondAttribute="leading" id="CIl-uD-o0w"/>
<constraint firstAttribute="trailing" secondItem="IcS-3H-XUB" secondAttribute="trailing" id="Cv2-YS-e4D"/> <constraint firstAttribute="trailing" secondItem="IcS-3H-XUB" secondAttribute="trailing" id="Cv2-YS-e4D"/>
<constraint firstItem="hDa-nl-Tlr" firstAttribute="leading" secondItem="zpX-41-Ngk" secondAttribute="leading" id="NhL-d5-aXA"/> <constraint firstItem="hDa-nl-Tlr" firstAttribute="leading" secondItem="zpX-41-Ngk" secondAttribute="leading" id="NhL-d5-aXA"/>
<constraint firstItem="evT-5t-rty" firstAttribute="leading" secondItem="zpX-41-Ngk" secondAttribute="leading" id="Og9-68-h35"/> <constraint firstItem="evT-5t-rty" firstAttribute="leading" secondItem="zpX-41-Ngk" secondAttribute="leading" id="Og9-68-h35"/>
<constraint firstItem="3n2-hH-xH7" firstAttribute="top" secondItem="Cy8-TS-7aW" secondAttribute="bottom" id="PIf-9Z-uEf"/> <constraint firstItem="HuL-FJ-3YQ" firstAttribute="top" secondItem="Cy8-TS-7aW" secondAttribute="bottom" id="PIf-9Z-uEf"/>
<constraint firstItem="IcS-3H-XUB" firstAttribute="top" secondItem="hDa-nl-Tlr" secondAttribute="bottom" id="VMa-R5-OFW"/> <constraint firstItem="IcS-3H-XUB" firstAttribute="top" secondItem="hDa-nl-Tlr" secondAttribute="bottom" id="VMa-R5-OFW"/>
<constraint firstAttribute="bottom" secondItem="evT-5t-rty" secondAttribute="bottom" id="XDr-SL-NMM"/> <constraint firstAttribute="bottom" secondItem="evT-5t-rty" secondAttribute="bottom" id="XDr-SL-NMM"/>
<constraint firstAttribute="trailing" secondItem="hDa-nl-Tlr" secondAttribute="trailing" id="a3q-U2-mJY"/> <constraint firstAttribute="trailing" secondItem="hDa-nl-Tlr" secondAttribute="trailing" id="a3q-U2-mJY"/>
<constraint firstItem="evT-5t-rty" firstAttribute="top" secondItem="gML-uH-K3J" secondAttribute="bottom" id="cux-9w-CGx"/> <constraint firstItem="evT-5t-rty" firstAttribute="top" secondItem="6iQ-dc-23W" secondAttribute="bottom" id="cux-9w-CGx"/>
<constraint firstItem="Cy8-TS-7aW" firstAttribute="leading" secondItem="zpX-41-Ngk" secondAttribute="leading" id="f5m-vf-b8j"/> <constraint firstItem="Cy8-TS-7aW" firstAttribute="leading" secondItem="zpX-41-Ngk" secondAttribute="leading" id="f5m-vf-b8j"/>
<constraint firstAttribute="trailing" secondItem="Cy8-TS-7aW" secondAttribute="trailing" id="iCF-U2-txU"/> <constraint firstAttribute="trailing" secondItem="Cy8-TS-7aW" secondAttribute="trailing" id="iCF-U2-txU"/>
<constraint firstItem="Cy8-TS-7aW" firstAttribute="top" secondItem="hDa-nl-Tlr" secondAttribute="bottom" id="kzM-OO-4XA"/> <constraint firstItem="Cy8-TS-7aW" firstAttribute="top" secondItem="hDa-nl-Tlr" secondAttribute="bottom" id="kzM-OO-4XA"/>
<constraint firstItem="3n2-hH-xH7" firstAttribute="top" secondItem="IcS-3H-XUB" secondAttribute="bottom" id="s35-CK-Hrw"/>
</constraints> </constraints>
</view> </view>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
...@@ -172,8 +172,8 @@ ...@@ -172,8 +172,8 @@
<objects> <objects>
<viewController storyboardIdentifier="KWMSearchBrandVC" hidesBottomBarWhenPushed="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="dZB-o0-0V5" userLabel="搜索品牌" customClass="KWMSearchBrandVC" sceneMemberID="viewController"> <viewController storyboardIdentifier="KWMSearchBrandVC" hidesBottomBarWhenPushed="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="dZB-o0-0V5" userLabel="搜索品牌" customClass="KWMSearchBrandVC" sceneMemberID="viewController">
<layoutGuides> <layoutGuides>
<viewControllerLayoutGuide type="top" id="BDj-Bc-fMI"/> <viewControllerLayoutGuide type="top" id="H4N-xb-DN3"/>
<viewControllerLayoutGuide type="bottom" id="ClW-aC-GMS"/> <viewControllerLayoutGuide type="bottom" id="F3B-dM-7gE"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="TAG-5I-k3z"> <view key="view" contentMode="scaleToFill" id="TAG-5I-k3z">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
...@@ -209,15 +209,15 @@ ...@@ -209,15 +209,15 @@
</subviews> </subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="Tbn-TE-Ey2" firstAttribute="top" secondItem="BDj-Bc-fMI" secondAttribute="bottom" id="6Lb-UQ-GiU"/> <constraint firstItem="Tbn-TE-Ey2" firstAttribute="top" secondItem="H4N-xb-DN3" secondAttribute="bottom" id="6Lb-UQ-GiU"/>
<constraint firstItem="Tbn-TE-Ey2" firstAttribute="leading" secondItem="TAG-5I-k3z" secondAttribute="leading" id="Bs0-Dh-YvD"/> <constraint firstItem="Tbn-TE-Ey2" firstAttribute="leading" secondItem="TAG-5I-k3z" secondAttribute="leading" id="Bs0-Dh-YvD"/>
<constraint firstItem="Xga-IN-Pq4" firstAttribute="leading" secondItem="TAG-5I-k3z" secondAttribute="leading" id="C43-NT-I65"/> <constraint firstItem="Xga-IN-Pq4" firstAttribute="leading" secondItem="TAG-5I-k3z" secondAttribute="leading" id="C43-NT-I65"/>
<constraint firstItem="Xga-IN-Pq4" firstAttribute="top" secondItem="TAG-5I-k3z" secondAttribute="top" constant="64" id="HqX-43-hzC"/> <constraint firstItem="Xga-IN-Pq4" firstAttribute="top" secondItem="H4N-xb-DN3" secondAttribute="bottom" constant="44" id="KEJ-xt-Ywd"/>
<constraint firstAttribute="trailing" secondItem="Tbn-TE-Ey2" secondAttribute="trailing" id="LP8-Zr-OcC"/> <constraint firstAttribute="trailing" secondItem="Tbn-TE-Ey2" secondAttribute="trailing" id="LP8-Zr-OcC"/>
<constraint firstItem="ClW-aC-GMS" firstAttribute="top" secondItem="gJI-aS-DRK" secondAttribute="bottom" id="PtC-MT-7E5"/>
<constraint firstAttribute="bottom" secondItem="Tbn-TE-Ey2" secondAttribute="bottom" id="TAb-Xe-bCR"/> <constraint firstAttribute="bottom" secondItem="Tbn-TE-Ey2" secondAttribute="bottom" id="TAb-Xe-bCR"/>
<constraint firstItem="gJI-aS-DRK" firstAttribute="top" secondItem="TAG-5I-k3z" secondAttribute="top" constant="65" id="fjn-hj-Gb9"/> <constraint firstAttribute="bottom" secondItem="gJI-aS-DRK" secondAttribute="bottom" id="WMI-Oz-4sQ"/>
<constraint firstAttribute="trailing" secondItem="gJI-aS-DRK" secondAttribute="trailing" id="gaI-ST-Scl"/> <constraint firstAttribute="trailing" secondItem="gJI-aS-DRK" secondAttribute="trailing" id="gaI-ST-Scl"/>
<constraint firstItem="gJI-aS-DRK" firstAttribute="top" secondItem="H4N-xb-DN3" secondAttribute="bottom" constant="45" id="h3X-zC-Xkm"/>
<constraint firstItem="gJI-aS-DRK" firstAttribute="leading" secondItem="TAG-5I-k3z" secondAttribute="leading" id="qiO-kD-Khu"/> <constraint firstItem="gJI-aS-DRK" firstAttribute="leading" secondItem="TAG-5I-k3z" secondAttribute="leading" id="qiO-kD-Khu"/>
<constraint firstAttribute="trailing" secondItem="Xga-IN-Pq4" secondAttribute="trailing" id="tfA-Pe-mo6"/> <constraint firstAttribute="trailing" secondItem="Xga-IN-Pq4" secondAttribute="trailing" id="tfA-Pe-mo6"/>
</constraints> </constraints>
......
...@@ -13,13 +13,6 @@ ...@@ -13,13 +13,6 @@
BOOL isShow; BOOL isShow;
} }
- (instancetype)init{
if (self = [super init]) {
[self initContentView];
}
return self;
}
-(instancetype)initWithFrame:(CGRect)frame{ -(instancetype)initWithFrame:(CGRect)frame{
if (self = [super initWithFrame:frame]) { if (self = [super initWithFrame:frame]) {
[self initContentView]; [self initContentView];
...@@ -34,9 +27,10 @@ ...@@ -34,9 +27,10 @@
return self; return self;
} }
- (void)awakeFromNib{ - (void)layoutSubviews
[super awakeFromNib]; {
[self initContentView]; [super layoutSubviews];
self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
} }
- (void)initContentView{ - (void)initContentView{
......
<?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="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<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>
<customFonts key="customFonts">
<array key="PingFang.ttc">
<string>PingFangSC-Semibold</string>
</array>
</customFonts>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMBarandSelectView"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMBarandSelectView">
<connections> <connections>
...@@ -19,18 +24,18 @@ ...@@ -19,18 +24,18 @@
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="zmX-9l-nYt"> <view contentMode="scaleToFill" id="zmX-9l-nYt">
<rect key="frame" x="0.0" y="0.0" width="375" height="64"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="w07-X3-TZc"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="w07-X3-TZc">
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/> <rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="20" id="I5b-cU-UJp"/> <constraint firstAttribute="height" id="I5b-cU-UJp"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LhU-hy-cgg"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LhU-hy-cgg">
<rect key="frame" x="0.0" y="20" width="375" height="44"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CAEAMEL" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eLp-Fc-DGP"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CAEAMEL" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eLp-Fc-DGP">
<rect key="frame" x="50" y="11" width="78" height="22"/> <rect key="frame" x="50" y="11" width="78" height="22"/>
......
...@@ -11,13 +11,6 @@ ...@@ -11,13 +11,6 @@
@implementation KWMCarCountView @implementation KWMCarCountView
- (instancetype)init{
if (self=[super init]) {
[self initContentView];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame{ - (instancetype)initWithFrame:(CGRect)frame{
if (self=[super initWithFrame:frame]) { if (self=[super initWithFrame:frame]) {
[self initContentView]; [self initContentView];
...@@ -32,11 +25,6 @@ ...@@ -32,11 +25,6 @@
return self; return self;
} }
- (void)awakeFromNib{
[super awakeFromNib];
[self initContentView];
}
- (void) initContentView{ - (void) initContentView{
[[NSBundle mainBundle] loadNibNamed:@"KWMCarCountView" owner:self options:nil]; [[NSBundle mainBundle] loadNibNamed:@"KWMCarCountView" owner:self options:nil];
self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
...@@ -57,6 +45,12 @@ ...@@ -57,6 +45,12 @@
} }
} }
- (void)layoutSubviews
{
[super layoutSubviews];
self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}
- (IBAction)onClickShopCartBtn:(id)sender { - (IBAction)onClickShopCartBtn:(id)sender {
NSLog(@"点击了购物车"); NSLog(@"点击了购物车");
if (self.delegate != nil) { if (self.delegate != nil) {
......
<?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="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<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>
<customFonts key="customFonts">
<array key="HelveticaNeue.ttc">
<string>HelveticaNeue</string>
</array>
<array key="PingFang.ttc">
<string>PingFangSC-Regular</string>
</array>
</customFonts>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMCarCountView"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMCarCountView">
<connections> <connections>
...@@ -18,18 +26,18 @@ ...@@ -18,18 +26,18 @@
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="R6r-bc-k21"> <view contentMode="scaleToFill" id="R6r-bc-k21">
<rect key="frame" x="0.0" y="0.0" width="375" height="64"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jaQ-9K-pwB"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jaQ-9K-pwB">
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/> <rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="20" id="1db-NU-cyT"/> <constraint firstAttribute="height" id="1db-NU-cyT"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="k5I-0u-ww6"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="k5I-0u-ww6">
<rect key="frame" x="0.0" y="20" width="375" height="44"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oya-px-46r"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oya-px-46r">
<rect key="frame" x="321" y="0.0" width="44" height="44"/> <rect key="frame" x="321" y="0.0" width="44" height="44"/>
...@@ -91,7 +99,7 @@ ...@@ -91,7 +99,7 @@
<constraint firstItem="k5I-0u-ww6" firstAttribute="leading" secondItem="R6r-bc-k21" secondAttribute="leading" id="U7I-TN-ssU"/> <constraint firstItem="k5I-0u-ww6" firstAttribute="leading" secondItem="R6r-bc-k21" secondAttribute="leading" id="U7I-TN-ssU"/>
<constraint firstAttribute="trailing" secondItem="jaQ-9K-pwB" secondAttribute="trailing" id="fSY-DF-L1l"/> <constraint firstAttribute="trailing" secondItem="jaQ-9K-pwB" secondAttribute="trailing" id="fSY-DF-L1l"/>
<constraint firstItem="jaQ-9K-pwB" firstAttribute="leading" secondItem="R6r-bc-k21" secondAttribute="leading" id="vmB-14-aYa"/> <constraint firstItem="jaQ-9K-pwB" firstAttribute="leading" secondItem="R6r-bc-k21" secondAttribute="leading" id="vmB-14-aYa"/>
<constraint firstItem="k5I-0u-ww6" firstAttribute="top" secondItem="R6r-bc-k21" secondAttribute="top" constant="20" id="wrG-1M-LtJ"/> <constraint firstItem="k5I-0u-ww6" firstAttribute="top" secondItem="R6r-bc-k21" secondAttribute="top" id="wrG-1M-LtJ"/>
<constraint firstItem="jaQ-9K-pwB" firstAttribute="top" secondItem="R6r-bc-k21" secondAttribute="top" id="zeW-XB-RBH"/> <constraint firstItem="jaQ-9K-pwB" firstAttribute="top" secondItem="R6r-bc-k21" secondAttribute="top" id="zeW-XB-RBH"/>
</constraints> </constraints>
<nil key="simulatedStatusBarMetrics"/> <nil key="simulatedStatusBarMetrics"/>
......
...@@ -12,13 +12,6 @@ ...@@ -12,13 +12,6 @@
BOOL isSearching; BOOL isSearching;
} }
- (instancetype)init{
if (self = [super init]) {
[self initContentView];
}
return self;
}
-(instancetype)initWithFrame:(CGRect)frame{ -(instancetype)initWithFrame:(CGRect)frame{
if (self = [super initWithFrame:frame]) { if (self = [super initWithFrame:frame]) {
[self initContentView]; [self initContentView];
...@@ -33,11 +26,6 @@ ...@@ -33,11 +26,6 @@
return self; return self;
} }
-(void)awakeFromNib{
[super awakeFromNib];
[self initContentView];
}
- (void)initContentView{ - (void)initContentView{
[[NSBundle mainBundle] loadNibNamed:@"KWMSearchBrandView" owner:self options:nil]; [[NSBundle mainBundle] loadNibNamed:@"KWMSearchBrandView" owner:self options:nil];
[self addSubview:_vContent]; [self addSubview:_vContent];
...@@ -47,6 +35,13 @@ ...@@ -47,6 +35,13 @@
self.tfBrand.returnKeyType = UIReturnKeySearch; self.tfBrand.returnKeyType = UIReturnKeySearch;
} }
- (void)layoutSubviews
{
[super layoutSubviews];
self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}
- (void)startAnimate{ - (void)startAnimate{
if (isSearching) {//搜索状态 if (isSearching) {//搜索状态
self.brandLeft.constant = 22 + 10 + 71 - UI_SCREEN_WIDTH; self.brandLeft.constant = 22 + 10 + 71 - UI_SCREEN_WIDTH;
......
...@@ -114,12 +114,12 @@ ...@@ -114,12 +114,12 @@
- (void)initHeaderView{ - (void)initHeaderView{
_barandSelectView = [[KWMBarandSelectView alloc] initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 64)]; self.barandSelectView = [[KWMBarandSelectView alloc]init];
_barandSelectView.count = [[KWMShoppingCart sharedInstance] count].integerValue; self.barandSelectView.count = [[KWMShoppingCart sharedInstance] count].integerValue;
_barandSelectView.lbBrand.text = [_brand uppercaseString]; self.barandSelectView.lbBrand.text = [_brand uppercaseString];
self.barandSelectView.delegate = self;
[self.view addSubview:_barandSelectView]; [self.view addSubview:_barandSelectView];
_barandSelectView.delegate = self; [self initCustomTitleBarConstarints:self.barandSelectView];
} }
static NSString *idStr = @"KWMBrandCaramelCell"; static NSString *idStr = @"KWMBrandCaramelCell";
......
...@@ -84,10 +84,11 @@ static NSString *cellId = @"KWMBrandCell"; ...@@ -84,10 +84,11 @@ static NSString *cellId = @"KWMBrandCell";
} }
- (void) initHeardView{ - (void) initHeardView{
_vCartCount = [[KWMCarCountView alloc] initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 64)]; self.vCartCount = [[KWMCarCountView alloc] init];
_vCartCount.count = [[KWMShoppingCart sharedInstance] count].integerValue; self.vCartCount.count = [[KWMShoppingCart sharedInstance] count].integerValue;
_vCartCount.delegate = self; self.vCartCount.delegate = self;
[self.view addSubview:_vCartCount]; [self.view addSubview:self.vCartCount];
[self initCustomTitleBarConstarints:self.vCartCount];
} }
- (void)initBrandNameAndImage{ - (void)initBrandNameAndImage{
...@@ -114,7 +115,6 @@ static NSString *cellId = @"KWMBrandCell"; ...@@ -114,7 +115,6 @@ static NSString *cellId = @"KWMBrandCell";
- (void)awakeFromNib{ - (void)awakeFromNib{
[super awakeFromNib]; [super awakeFromNib];
self.title = @"品牌"; self.title = @"品牌";
} }
-(void)onClickMoreBrand:(id)sender{ -(void)onClickMoreBrand:(id)sender{
......
...@@ -67,9 +67,10 @@ ...@@ -67,9 +67,10 @@
} }
- (void)initHeaderView{ - (void)initHeaderView{
_searchBrandView = [[KWMSearchBrandView alloc] initWithFrame:CGRectMake(0, 20, UI_SCREEN_WIDTH, 44)]; self.searchBrandView = [[KWMSearchBrandView alloc] init];
[self.view addSubview:_searchBrandView]; [self.view addSubview:_searchBrandView];
_searchBrandView.delegate = self; self.searchBrandView.delegate = self;
[self initCustomTitleBarConstarints:self.searchBrandView];
} }
static NSString *identify = @"KWMSearchBrandsCell"; static NSString *identify = @"KWMSearchBrandsCell";
......
...@@ -21,13 +21,6 @@ ...@@ -21,13 +21,6 @@
@implementation KWMCategoryTitleView @implementation KWMCategoryTitleView
- (id)init{
if (self=[super init]){
[self addView];
}
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder { - (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder]; self = [super initWithCoder:aDecoder];
if (self) { if (self) {
...@@ -45,7 +38,6 @@ ...@@ -45,7 +38,6 @@
-(void)awakeFromNib{ -(void)awakeFromNib{
[super awakeFromNib]; [super awakeFromNib];
[self addView];
} }
-(void) addView{ -(void) addView{
...@@ -62,6 +54,12 @@ ...@@ -62,6 +54,12 @@
[self.vSearchBar setBorder:0 cornerRadius:2 borderColor:nil]; [self.vSearchBar setBorder:0 cornerRadius:2 borderColor:nil];
} }
- (void)layoutSubviews
{
[super layoutSubviews];
self.vView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}
-(void)setCount:(NSNumber *)count{ -(void)setCount:(NSNumber *)count{
_count = count; _count = count;
self.lbCount.text = count.stringValue; self.lbCount.text = count.stringValue;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<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>
<customFonts key="customFonts"> <customFonts key="customFonts">
...@@ -23,18 +23,18 @@ ...@@ -23,18 +23,18 @@
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB"> <view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="375" height="64"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hKF-vD-6Tp"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hKF-vD-6Tp">
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/> <rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="20" id="fZ2-lU-6fn"/> <constraint firstAttribute="height" id="fZ2-lU-6fn"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fl4-ro-VaX" userLabel="vContent"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fl4-ro-VaX" userLabel="vContent">
<rect key="frame" x="0.0" y="20" width="375" height="44"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Cc-is-gm9" userLabel="btn_shop_cart"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Cc-is-gm9" userLabel="btn_shop_cart">
<rect key="frame" x="321" y="0.0" width="44" height="44"/> <rect key="frame" x="321" y="0.0" width="44" height="44"/>
......
...@@ -152,10 +152,11 @@ ...@@ -152,10 +152,11 @@
[self.navigationController setNavigationBarHidden:YES]; [self.navigationController setNavigationBarHidden:YES];
NSNumber *count = [[KWMShoppingCart sharedInstance] count]; NSNumber *count = [[KWMShoppingCart sharedInstance] count];
self.titleView = [[KWMCategoryTitleView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 64)]; self.titleView = [[KWMCategoryTitleView alloc] init];
self.titleView.delegate = self; self.titleView.delegate = self;
self.titleView.count = count; self.titleView.count = count;
[self.view addSubview:self.titleView]; [self.view addSubview:self.titleView];
[self initCustomTitleBarConstarints:self.titleView];
} }
#pragma mark -- KWMCategoryTitleDelegate #pragma mark -- KWMCategoryTitleDelegate
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<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>
<customFonts key="customFonts">
<array key="PingFang.ttc">
<string>PingFangSC-Regular</string>
</array>
</customFonts>
<scenes> <scenes>
<!--博客详情--> <!--博客详情-->
<scene sceneID="DWf-pX-AYa"> <scene sceneID="DWf-pX-AYa">
...@@ -78,8 +83,8 @@ ...@@ -78,8 +83,8 @@
<constraints> <constraints>
<constraint firstItem="XdN-GP-LIS" firstAttribute="leading" secondItem="k5a-vQ-s85" secondAttribute="leading" id="NJ9-VE-w3D"/> <constraint firstItem="XdN-GP-LIS" firstAttribute="leading" secondItem="k5a-vQ-s85" secondAttribute="leading" id="NJ9-VE-w3D"/>
<constraint firstAttribute="trailing" secondItem="XdN-GP-LIS" secondAttribute="trailing" id="Urr-pn-Jrq"/> <constraint firstAttribute="trailing" secondItem="XdN-GP-LIS" secondAttribute="trailing" id="Urr-pn-Jrq"/>
<constraint firstItem="rO7-Am-QA1" firstAttribute="top" secondItem="XdN-GP-LIS" secondAttribute="bottom" id="ajN-GQ-ChV"/>
<constraint firstItem="XdN-GP-LIS" firstAttribute="top" secondItem="5PW-Pq-dm1" secondAttribute="bottom" id="iH1-hu-dA8"/> <constraint firstItem="XdN-GP-LIS" firstAttribute="top" secondItem="5PW-Pq-dm1" secondAttribute="bottom" id="iH1-hu-dA8"/>
<constraint firstAttribute="bottom" secondItem="XdN-GP-LIS" secondAttribute="bottom" id="kAG-NR-E8J"/>
</constraints> </constraints>
</view> </view>
<connections> <connections>
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
- (void)keyboardWillHide:(NSNotification *)notification; - (void)keyboardWillHide:(NSNotification *)notification;
- (void)keyboardWillShow:(NSNotification *)notification; - (void)keyboardWillShow:(NSNotification *)notification;
- (void)keyboardWillChangeFrame:(NSNotification *)notification; - (void)keyboardWillChangeFrame:(NSNotification *)notification;
- (void)initCustomTitleBarConstarints:(UIView *)titleView;
- (UIBarButtonItem *)createBarButtonItem:(NSString *)title - (UIBarButtonItem *)createBarButtonItem:(NSString *)title
image:(UIImage *)image image:(UIImage *)image
action:(SEL)action; action:(SEL)action;
......
...@@ -301,6 +301,16 @@ ...@@ -301,6 +301,16 @@
NSAssert(NO, @"调用尚未实现的方法"); NSAssert(NO, @"调用尚未实现的方法");
} }
- (void)initCustomTitleBarConstarints:(UIView *)titleView{
id mTopLayoutGuide = self.topLayoutGuide;
// 使用autoLayout约束,禁止将AutoresizingMask转换为约束
[titleView setTranslatesAutoresizingMaskIntoConstraints:NO];
NSDictionary *views = NSDictionaryOfVariableBindings(titleView);
NSDictionary *views2 = NSDictionaryOfVariableBindings(titleView,mTopLayoutGuide);
[self.view addConstraints: [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[titleView]|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[mTopLayoutGuide]-0-[titleView(44.0)]" options:0 metrics:nil views:views2]];
}
-(BOOL)checkLogin{ -(BOOL)checkLogin{
KWMUserModel *user = [KWMUserModel shareUser]; KWMUserModel *user = [KWMUserModel shareUser];
if (user.status != 1) { if (user.status != 1) {
......
...@@ -10,19 +10,13 @@ ...@@ -10,19 +10,13 @@
@implementation KWMMineTitleView @implementation KWMMineTitleView
- (instancetype)init{
if (self = [super init]) {
[self initContentView];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{ - (instancetype)initWithCoder:(NSCoder *)aDecoder{
if (self = [super initWithCoder:aDecoder]) { if (self = [super initWithCoder:aDecoder]) {
[self initContentView]; [self initContentView];
} }
return self; return self;
} }
- (instancetype)initWithFrame:(CGRect)frame{ - (instancetype)initWithFrame:(CGRect)frame{
if (self = [super initWithFrame:frame]) { if (self = [super initWithFrame:frame]) {
[self initContentView]; [self initContentView];
...@@ -32,9 +26,13 @@ ...@@ -32,9 +26,13 @@
- (void)initContentView{ - (void)initContentView{
[[NSBundle mainBundle ]loadNibNamed:@"KWMMineTitleView" owner:self options:nil]; [[NSBundle mainBundle ]loadNibNamed:@"KWMMineTitleView" owner:self options:nil];
self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
[self addSubview:_vContent]; [self addSubview:_vContent];
} }
- (void)layoutSubviews
{
[super layoutSubviews];
self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}
@end @end
<?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="11542" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<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>
<customFonts key="customFonts">
<array key="PingFang.ttc">
<string>PingFangSC-Light</string>
<string>PingFangSC-Medium</string>
</array>
</customFonts>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMMineTitleView"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMMineTitleView">
<connections> <connections>
...@@ -18,18 +24,18 @@ ...@@ -18,18 +24,18 @@
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="BgZ-g4-beh" userLabel="vContent"> <view contentMode="scaleToFill" id="BgZ-g4-beh" userLabel="vContent">
<rect key="frame" x="0.0" y="0.0" width="375" height="64"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bel-fl-SfK"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bel-fl-SfK">
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/> <rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="20" id="NY3-Oh-oda"/> <constraint firstAttribute="height" id="NY3-Oh-oda"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6KD-73-iA6"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6KD-73-iA6">
<rect key="frame" x="0.0" y="20" width="375" height="44"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我的" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YAC-CC-nAy"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我的" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YAC-CC-nAy">
<rect key="frame" x="175.5" y="0.0" width="24" height="22"/> <rect key="frame" x="175.5" y="0.0" width="24" height="22"/>
......
...@@ -60,7 +60,8 @@ ...@@ -60,7 +60,8 @@
} }
- (void)initHeaderView{ - (void)initHeaderView{
_vTitle = [[KWMMineTitleView alloc] initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 64)]; _vTitle = [[KWMMineTitleView alloc] init];
// _vTitle = [[KWMMineTitleView alloc] initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 64)];
_vTitle.lbUserName.text = _user.status ? _user.name : @"未登录"; _vTitle.lbUserName.text = _user.status ? _user.name : @"未登录";
if (_user.status == 1) { if (_user.status == 1) {
[self.btnLogin setTitle:@"退出" forState:UIControlStateNormal]; [self.btnLogin setTitle:@"退出" forState:UIControlStateNormal];
...@@ -70,7 +71,7 @@ ...@@ -70,7 +71,7 @@
[self.btnLogin setImage:[UIImage imageNamed:@"button_mine_login"] forState:UIControlStateNormal]; [self.btnLogin setImage:[UIImage imageNamed:@"button_mine_login"] forState:UIControlStateNormal];
} }
[self.view addSubview:_vTitle]; [self.view addSubview:_vTitle];
[self initCustomTitleBarConstarints:_vTitle];
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
...@@ -187,6 +187,9 @@ ...@@ -187,6 +187,9 @@
self.client.customerToken = [BUYCustomerToken customerTokenWithJSONDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:@"token"]]; self.client.customerToken = [BUYCustomerToken customerTokenWithJSONDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:@"token"]];
[self.client getOrdersForCustomerCallback:^(NSArray<BUYOrder *> * _Nullable orders, NSError * _Nullable error) { [self.client getOrdersForCustomerCallback:^(NSArray<BUYOrder *> * _Nullable orders, NSError * _Nullable error) {
for (int i = 0; i<orders.count; i++) {
NSLog(@"langArray[%d]=%@", i,orders[i].JSONDictionary);
}
[weakSelf hideLoading]; [weakSelf hideLoading];
if (error == nil && orders != nil ) { if (error == nil && orders != nil ) {
[weakSelf.orderList removeAllObjects]; [weakSelf.orderList removeAllObjects];
......
...@@ -114,10 +114,11 @@ typedef enum{ ...@@ -114,10 +114,11 @@ typedef enum{
} }
-(void)initTitleView{ -(void)initTitleView{
self.titleView = [[KWMSearchBar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 64)]; self.titleView = [[KWMSearchBar alloc] init];
self.titleView.delegate = self; self.titleView.delegate = self;
self.titleView.btnSearch.hidden = NO; self.titleView.btnSearch.hidden = NO;
[self.view addSubview:self.titleView]; [self.view addSubview:self.titleView];
[self initCustomTitleBarConstarints:self.titleView];
} }
- (void)initCollectionView{ - (void)initCollectionView{
......
...@@ -151,12 +151,32 @@ ...@@ -151,12 +151,32 @@
<action selector="onClickShopCart:" destination="Vzq-D6-e57" eventType="touchUpInside" id="rOf-cw-IRH"/> <action selector="onClickShopCart:" destination="Vzq-D6-e57" eventType="touchUpInside" id="rOf-cw-IRH"/>
</connections> </connections>
</button> </button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jxc-tQ-Uvl" userLabel="line">
<rect key="frame" x="0.0" y="0.0" width="80" height="1"/>
<color key="backgroundColor" red="0.84705882352941175" green="0.85882352941176465" blue="0.87058823529411766" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="dEf-Kf-tOU"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SsT-tp-tcA" userLabel="line">
<rect key="frame" x="0.0" y="49" width="80" height="1"/>
<color key="backgroundColor" red="0.84705882349999995" green="0.85882352939999995" blue="0.87058823529999996" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="8D1-12-8eD"/>
</constraints>
</view>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="80" id="0qC-Tw-VN0"/> <constraint firstAttribute="width" constant="80" id="0qC-Tw-VN0"/>
<constraint firstItem="Jxc-tQ-Uvl" firstAttribute="top" secondItem="p6D-hx-qVB" secondAttribute="top" id="5BL-i2-XEO"/>
<constraint firstItem="Jxc-tQ-Uvl" firstAttribute="leading" secondItem="p6D-hx-qVB" secondAttribute="leading" id="EXa-s5-aZV"/>
<constraint firstItem="SsT-tp-tcA" firstAttribute="leading" secondItem="p6D-hx-qVB" secondAttribute="leading" id="Im8-La-slV"/>
<constraint firstAttribute="bottom" secondItem="SsT-tp-tcA" secondAttribute="bottom" id="Y16-zp-sdL"/>
<constraint firstItem="gbx-rg-A8B" firstAttribute="centerX" secondItem="p6D-hx-qVB" secondAttribute="centerX" id="fWx-g7-oy7"/> <constraint firstItem="gbx-rg-A8B" firstAttribute="centerX" secondItem="p6D-hx-qVB" secondAttribute="centerX" id="fWx-g7-oy7"/>
<constraint firstItem="gbx-rg-A8B" firstAttribute="centerY" secondItem="p6D-hx-qVB" secondAttribute="centerY" id="fet-ki-2vJ"/> <constraint firstItem="gbx-rg-A8B" firstAttribute="centerY" secondItem="p6D-hx-qVB" secondAttribute="centerY" id="fet-ki-2vJ"/>
<constraint firstAttribute="trailing" secondItem="Jxc-tQ-Uvl" secondAttribute="trailing" id="kHN-ud-ZhE"/>
<constraint firstAttribute="trailing" secondItem="SsT-tp-tcA" secondAttribute="trailing" id="w8n-Bj-0GH"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YFr-wz-mgl"> <button opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YFr-wz-mgl">
...@@ -181,22 +201,12 @@ ...@@ -181,22 +201,12 @@
<action selector="onClickComplete:" destination="Vzq-D6-e57" eventType="touchUpInside" id="tO6-dz-eNt"/> <action selector="onClickComplete:" destination="Vzq-D6-e57" eventType="touchUpInside" id="tO6-dz-eNt"/>
</connections> </connections>
</button> </button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jxc-tQ-Uvl" userLabel="line">
<rect key="frame" x="0.0" y="0.0" width="375" height="1"/>
<color key="backgroundColor" red="0.84705882352941175" green="0.85882352941176465" blue="0.87058823529411766" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="dEf-Kf-tOU"/>
</constraints>
</view>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstItem="p6D-hx-qVB" firstAttribute="leading" secondItem="aqB-2y-BKU" secondAttribute="leading" id="9CF-cd-J2w"/> <constraint firstItem="p6D-hx-qVB" firstAttribute="leading" secondItem="aqB-2y-BKU" secondAttribute="leading" id="9CF-cd-J2w"/>
<constraint firstAttribute="trailing" secondItem="oPf-c2-z7n" secondAttribute="trailing" id="Iie-17-jiS"/> <constraint firstAttribute="trailing" secondItem="oPf-c2-z7n" secondAttribute="trailing" id="Iie-17-jiS"/>
<constraint firstAttribute="trailing" secondItem="Jxc-tQ-Uvl" secondAttribute="trailing" id="KMf-E2-2Eb"/>
<constraint firstAttribute="bottom" secondItem="oPf-c2-z7n" secondAttribute="bottom" id="QCf-h9-wdW"/> <constraint firstAttribute="bottom" secondItem="oPf-c2-z7n" secondAttribute="bottom" id="QCf-h9-wdW"/>
<constraint firstItem="Jxc-tQ-Uvl" firstAttribute="leading" secondItem="aqB-2y-BKU" secondAttribute="leading" id="RKe-Wt-6Io"/>
<constraint firstItem="Jxc-tQ-Uvl" firstAttribute="top" secondItem="aqB-2y-BKU" secondAttribute="top" id="UAc-9x-8KP"/>
<constraint firstAttribute="height" constant="50" id="WhH-yK-gHq"/> <constraint firstAttribute="height" constant="50" id="WhH-yK-gHq"/>
<constraint firstItem="YFr-wz-mgl" firstAttribute="leading" secondItem="p6D-hx-qVB" secondAttribute="trailing" id="Z0o-FF-rB3"/> <constraint firstItem="YFr-wz-mgl" firstAttribute="leading" secondItem="p6D-hx-qVB" secondAttribute="trailing" id="Z0o-FF-rB3"/>
<constraint firstItem="p6D-hx-qVB" firstAttribute="top" secondItem="aqB-2y-BKU" secondAttribute="top" id="fu6-hx-f4P"/> <constraint firstItem="p6D-hx-qVB" firstAttribute="top" secondItem="aqB-2y-BKU" secondAttribute="top" id="fu6-hx-f4P"/>
...@@ -214,9 +224,9 @@ ...@@ -214,9 +224,9 @@
<constraint firstAttribute="trailing" secondItem="aqB-2y-BKU" secondAttribute="trailing" id="2B4-2I-dss"/> <constraint firstAttribute="trailing" secondItem="aqB-2y-BKU" secondAttribute="trailing" id="2B4-2I-dss"/>
<constraint firstItem="kgb-zB-eBa" firstAttribute="top" secondItem="Pjy-Ny-sa9" secondAttribute="bottom" id="3J0-tF-Mna"/> <constraint firstItem="kgb-zB-eBa" firstAttribute="top" secondItem="Pjy-Ny-sa9" secondAttribute="bottom" id="3J0-tF-Mna"/>
<constraint firstItem="aqB-2y-BKU" firstAttribute="leading" secondItem="IxM-8o-F8K" secondAttribute="leading" id="6I6-ul-bGF"/> <constraint firstItem="aqB-2y-BKU" firstAttribute="leading" secondItem="IxM-8o-F8K" secondAttribute="leading" id="6I6-ul-bGF"/>
<constraint firstAttribute="bottom" secondItem="aqB-2y-BKU" secondAttribute="bottom" id="97w-S0-S0x"/>
<constraint firstAttribute="trailing" secondItem="T6J-Gp-5iu" secondAttribute="trailing" id="B5K-Fj-FOR"/> <constraint firstAttribute="trailing" secondItem="T6J-Gp-5iu" secondAttribute="trailing" id="B5K-Fj-FOR"/>
<constraint firstItem="T6J-Gp-5iu" firstAttribute="leading" secondItem="IxM-8o-F8K" secondAttribute="leading" id="DZE-DY-3SX"/> <constraint firstItem="T6J-Gp-5iu" firstAttribute="leading" secondItem="IxM-8o-F8K" secondAttribute="leading" id="DZE-DY-3SX"/>
<constraint firstItem="5rs-FM-Imo" firstAttribute="top" secondItem="aqB-2y-BKU" secondAttribute="bottom" id="Dag-cY-cd9"/>
<constraint firstAttribute="trailing" secondItem="kgb-zB-eBa" secondAttribute="trailing" id="FyY-BZ-73X"/> <constraint firstAttribute="trailing" secondItem="kgb-zB-eBa" secondAttribute="trailing" id="FyY-BZ-73X"/>
<constraint firstItem="kgb-zB-eBa" firstAttribute="leading" secondItem="IxM-8o-F8K" secondAttribute="leading" id="KfD-qL-WSj"/> <constraint firstItem="kgb-zB-eBa" firstAttribute="leading" secondItem="IxM-8o-F8K" secondAttribute="leading" id="KfD-qL-WSj"/>
<constraint firstItem="aqB-2y-BKU" firstAttribute="top" secondItem="T6J-Gp-5iu" secondAttribute="bottom" id="kEG-am-iPo"/> <constraint firstItem="aqB-2y-BKU" firstAttribute="top" secondItem="T6J-Gp-5iu" secondAttribute="bottom" id="kEG-am-iPo"/>
......
...@@ -10,13 +10,6 @@ ...@@ -10,13 +10,6 @@
@implementation KWMSearchFeedBackView @implementation KWMSearchFeedBackView
- (instancetype)init{
if (self = [super init]) {
[self initContentView];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame{ - (instancetype)initWithFrame:(CGRect)frame{
if (self = [super initWithFrame:frame]) { if (self = [super initWithFrame:frame]) {
...@@ -33,16 +26,10 @@ ...@@ -33,16 +26,10 @@
return self; return self;
} }
- (void)awakeFromNib{
[super awakeFromNib];
[self initContentView];
}
- (void)initContentView{ - (void)initContentView{
[[NSBundle mainBundle] loadNibNamed:@"KWMSearchFeedBackView" owner:self options:nil]; [[NSBundle mainBundle] loadNibNamed:@"KWMSearchFeedBackView" owner:self options:nil];
[self addSubview:self.vContent]; [self addSubview:self.vContent];
self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
self.lbGoodsNum.hidden = YES; self.lbGoodsNum.hidden = YES;
} }
- (IBAction)onClickSearchBtn:(id)sender { - (IBAction)onClickSearchBtn:(id)sender {
...@@ -57,6 +44,12 @@ ...@@ -57,6 +44,12 @@
} }
} }
- (void)layoutSubviews
{
[super layoutSubviews];
self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}
#pragma mark -- UITextFieldDelegate #pragma mark -- UITextFieldDelegate
- (BOOL)textFieldShouldReturn:(UITextField *)textField{ - (BOOL)textFieldShouldReturn:(UITextField *)textField{
NSString *string = textField.text; NSString *string = textField.text;
......
<?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="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<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>
<customFonts key="customFonts">
<array key="PingFang.ttc">
<string>PingFangSC-Light</string>
</array>
</customFonts>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMSearchFeedBackView"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMSearchFeedBackView">
<connections> <connections>
...@@ -20,18 +25,18 @@ ...@@ -20,18 +25,18 @@
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="kdr-EL-mmm" userLabel="vContent"> <view contentMode="scaleToFill" id="kdr-EL-mmm" userLabel="vContent">
<rect key="frame" x="0.0" y="0.0" width="375" height="64"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vky-bm-ecy"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vky-bm-ecy">
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/> <rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="20" id="Rip-Uy-a7h"/> <constraint firstAttribute="height" id="Rip-Uy-a7h"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Qs-Qo-CtH"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Qs-Qo-CtH">
<rect key="frame" x="0.0" y="20" width="375" height="44"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ggn-e9-wbW"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ggn-e9-wbW">
<rect key="frame" x="10" y="11" width="22" height="22"/> <rect key="frame" x="10" y="11" width="22" height="22"/>
......
...@@ -79,13 +79,13 @@ static NSString *idStr = @"KWMBrandCaramelCell"; ...@@ -79,13 +79,13 @@ static NSString *idStr = @"KWMBrandCaramelCell";
} }
- (void)initHeardView{ - (void)initHeardView{
self.vSearchFB = [[KWMSearchFeedBackView alloc] init];
_vSearchFB = [[KWMSearchFeedBackView alloc] initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 64)]; self.vSearchFB.tfSearch.text = self.searchText;
_vSearchFB.tfSearch.text = self.searchText; self.vSearchFB.lbGoodsNum.hidden = NO;
_vSearchFB.lbGoodsNum.hidden = NO; self.vSearchFB.lbGoodsNum.text = [NSString stringWithFormat:@"%lu商品",(unsigned long)total];
_vSearchFB.lbGoodsNum.text = [NSString stringWithFormat:@"%lu商品",(unsigned long)total]; self.vSearchFB.delegate = self;
_vSearchFB.delegate = self; [self.view addSubview:self.vSearchFB];
[self.view addSubview:_vSearchFB]; [self initCustomTitleBarConstarints:self.vSearchFB];
} }
#pragma mark -- KWMBrandCaramelCellDelegate #pragma mark -- KWMBrandCaramelCellDelegate
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="Constraints to layout margins" minToolsVersion="6.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>
...@@ -251,10 +251,10 @@ ...@@ -251,10 +251,10 @@
</connections> </connections>
</tableView> </tableView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wbB-ey-Zag" userLabel="vNoGoods"> <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wbB-ey-Zag" userLabel="vNoGoods">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="20" width="375" height="647"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="暂无商品" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fNr-vb-Qf7"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="暂无商品" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fNr-vb-Qf7">
<rect key="frame" x="154.5" y="323" width="66" height="21"/> <rect key="frame" x="154.5" y="313" width="66" height="21"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="66" id="nfp-BN-Tdh"/> <constraint firstAttribute="width" constant="66" id="nfp-BN-Tdh"/>
<constraint firstAttribute="height" constant="21" id="wU7-LY-bkV"/> <constraint firstAttribute="height" constant="21" id="wU7-LY-bkV"/>
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_brand_not quite available" translatesAutoresizingMaskIntoConstraints="NO" id="CVd-db-6Nq"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_brand_not quite available" translatesAutoresizingMaskIntoConstraints="NO" id="CVd-db-6Nq">
<rect key="frame" x="168.5" y="262" width="38" height="43"/> <rect key="frame" x="168.5" y="252" width="38" height="43"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="43" id="QB8-O7-9hQ"/> <constraint firstAttribute="height" constant="43" id="QB8-O7-9hQ"/>
<constraint firstAttribute="width" constant="37.530000000000001" id="hdJ-uX-QNB"/> <constraint firstAttribute="width" constant="37.530000000000001" id="hdJ-uX-QNB"/>
...@@ -280,22 +280,22 @@ ...@@ -280,22 +280,22 @@
</constraints> </constraints>
</view> </view>
<view hidden="YES" alpha="0.59999999999999998" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0gx-v6-eAP"> <view hidden="YES" alpha="0.59999999999999998" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0gx-v6-eAP">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
</view> </view>
</subviews> </subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="wbB-ey-Zag" firstAttribute="top" secondItem="YH1-IF-LTL" secondAttribute="bottom" id="B2o-AQ-KaO"/>
<constraint firstAttribute="bottom" secondItem="0gx-v6-eAP" secondAttribute="bottom" id="JWf-1t-OhT"/> <constraint firstAttribute="bottom" secondItem="0gx-v6-eAP" secondAttribute="bottom" id="JWf-1t-OhT"/>
<constraint firstAttribute="bottom" secondItem="Fmw-OX-y1u" secondAttribute="bottom" id="KDQ-E4-wkV"/> <constraint firstAttribute="bottom" secondItem="Fmw-OX-y1u" secondAttribute="bottom" id="KDQ-E4-wkV"/>
<constraint firstItem="taY-Y0-CRF" firstAttribute="top" secondItem="GXA-CG-nHY" secondAttribute="top" constant="64" id="O4E-7c-QiS"/> <constraint firstItem="0gx-v6-eAP" firstAttribute="top" secondItem="YH1-IF-LTL" secondAttribute="bottom" id="N4t-V3-Lgo"/>
<constraint firstItem="taY-Y0-CRF" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="QND-SZ-tAr"/> <constraint firstItem="taY-Y0-CRF" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="QND-SZ-tAr"/>
<constraint firstAttribute="trailing" secondItem="wbB-ey-Zag" secondAttribute="trailing" id="QVg-n3-hOZ"/> <constraint firstAttribute="trailing" secondItem="wbB-ey-Zag" secondAttribute="trailing" id="QVg-n3-hOZ"/>
<constraint firstItem="Fmw-OX-y1u" firstAttribute="top" secondItem="GXA-CG-nHY" secondAttribute="top" constant="65" id="XBY-zg-a9u"/> <constraint firstItem="taY-Y0-CRF" firstAttribute="top" secondItem="YH1-IF-LTL" secondAttribute="bottom" constant="44" id="Tf5-pk-8Wd"/>
<constraint firstItem="wbB-ey-Zag" firstAttribute="top" secondItem="GXA-CG-nHY" secondAttribute="top" id="ZQ3-kW-slY"/>
<constraint firstAttribute="trailing" secondItem="taY-Y0-CRF" secondAttribute="trailing" id="aew-aA-WyS"/> <constraint firstAttribute="trailing" secondItem="taY-Y0-CRF" secondAttribute="trailing" id="aew-aA-WyS"/>
<constraint firstItem="0gx-v6-eAP" firstAttribute="top" secondItem="GXA-CG-nHY" secondAttribute="top" id="dO9-sW-Trm"/>
<constraint firstAttribute="trailing" secondItem="0gx-v6-eAP" secondAttribute="trailing" id="fII-UN-CCe"/> <constraint firstAttribute="trailing" secondItem="0gx-v6-eAP" secondAttribute="trailing" id="fII-UN-CCe"/>
<constraint firstItem="Fmw-OX-y1u" firstAttribute="top" secondItem="taY-Y0-CRF" secondAttribute="bottom" id="fbc-Mp-VjF"/>
<constraint firstAttribute="bottom" secondItem="wbB-ey-Zag" secondAttribute="bottom" id="iRq-ft-rl5"/> <constraint firstAttribute="bottom" secondItem="wbB-ey-Zag" secondAttribute="bottom" id="iRq-ft-rl5"/>
<constraint firstItem="Fmw-OX-y1u" firstAttribute="top" secondItem="YH1-IF-LTL" secondAttribute="bottom" constant="-20" id="kf6-GV-ebU"/> <constraint firstItem="Fmw-OX-y1u" firstAttribute="top" secondItem="YH1-IF-LTL" secondAttribute="bottom" constant="-20" id="kf6-GV-ebU"/>
<constraint firstItem="Fmw-OX-y1u" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="pet-Wg-LZs"/> <constraint firstItem="Fmw-OX-y1u" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="pet-Wg-LZs"/>
......
...@@ -11,13 +11,6 @@ ...@@ -11,13 +11,6 @@
@implementation KWMSearchBar @implementation KWMSearchBar
- (id)init{
if (self=[super init]){
[self addView];
}
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder { - (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder]; self = [super initWithCoder:aDecoder];
if (self) { if (self) {
...@@ -33,17 +26,11 @@ ...@@ -33,17 +26,11 @@
return self; return self;
} }
-(void)awakeFromNib{
[super awakeFromNib];
[self addView];
}
-(void) addView{ -(void) addView{
[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class])
owner:self owner:self
options:nil]; options:nil];
self.vView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
[self addSubview:self.vView]; [self addSubview:self.vView];
[self.vCount setUserInteractionEnabled:NO]; [self.vCount setUserInteractionEnabled:NO];
[self.lbCount setUserInteractionEnabled:NO]; [self.lbCount setUserInteractionEnabled:NO];
...@@ -53,6 +40,12 @@ ...@@ -53,6 +40,12 @@
[self initView]; [self initView];
} }
- (void)layoutSubviews
{
[super layoutSubviews];
self.vView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}
- (void)setCount:(NSInteger)count{ - (void)setCount:(NSInteger)count{
_count = count; _count = count;
if (count > 0) { if (count > 0) {
......
<?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="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<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>
<customFonts key="customFonts">
<array key="PingFang.ttc">
<string>PingFangSC-Light</string>
</array>
</customFonts>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMSearchBar"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMSearchBar">
<connections> <connections>
...@@ -25,18 +30,18 @@ ...@@ -25,18 +30,18 @@
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB"> <view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="375" height="64"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DoM-T9-tzd"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DoM-T9-tzd">
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/> <rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="20" id="tcd-zY-CfJ"/> <constraint firstAttribute="height" id="tcd-zY-CfJ"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Fg-do-aH3" userLabel="vContent"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Fg-do-aH3" userLabel="vContent">
<rect key="frame" x="0.0" y="20" width="375" height="44"/> <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="im_logo" translatesAutoresizingMaskIntoConstraints="NO" id="GA3-Mh-Bf7"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="im_logo" translatesAutoresizingMaskIntoConstraints="NO" id="GA3-Mh-Bf7">
<rect key="frame" x="20" y="10" width="135" height="24"/> <rect key="frame" x="20" y="10" width="135" height="24"/>
...@@ -136,7 +141,7 @@ ...@@ -136,7 +141,7 @@
<constraints> <constraints>
<constraint firstAttribute="bottom" secondItem="9Fg-do-aH3" secondAttribute="bottom" id="Irf-Eu-HZz"/> <constraint firstAttribute="bottom" secondItem="9Fg-do-aH3" secondAttribute="bottom" id="Irf-Eu-HZz"/>
<constraint firstAttribute="trailing" secondItem="9Fg-do-aH3" secondAttribute="trailing" id="WiV-9o-qew"/> <constraint firstAttribute="trailing" secondItem="9Fg-do-aH3" secondAttribute="trailing" id="WiV-9o-qew"/>
<constraint firstItem="9Fg-do-aH3" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="20" id="ZKG-cY-8cO"/> <constraint firstItem="9Fg-do-aH3" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="ZKG-cY-8cO"/>
<constraint firstItem="DoM-T9-tzd" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="hlY-pE-sYP"/> <constraint firstItem="DoM-T9-tzd" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="hlY-pE-sYP"/>
<constraint firstItem="DoM-T9-tzd" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="iMh-jN-7jR"/> <constraint firstItem="DoM-T9-tzd" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="iMh-jN-7jR"/>
<constraint firstAttribute="trailing" secondItem="DoM-T9-tzd" secondAttribute="trailing" id="iwr-FN-dhi"/> <constraint firstAttribute="trailing" secondItem="DoM-T9-tzd" secondAttribute="trailing" id="iwr-FN-dhi"/>
......
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