Commit 68c2876c by houweibin

ui fix

parent b344e457
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<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>
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nBP-0Q-eKB" userLabel="推荐搭配title view"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nBP-0Q-eKB" userLabel="推荐搭配title view">
<rect key="frame" x="0.0" y="0.0" width="375" height="190"/> <rect key="frame" x="0.0" y="0.0" width="375" height="190"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="test_suit" translatesAutoresizingMaskIntoConstraints="NO" id="Xzr-zM-E25"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Xzr-zM-E25">
<rect key="frame" x="0.0" y="0.0" width="375" height="190"/> <rect key="frame" x="0.0" y="0.0" width="375" height="190"/>
</imageView> </imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_triangle" translatesAutoresizingMaskIntoConstraints="NO" id="LvJ-FP-Yc1"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_triangle" translatesAutoresizingMaskIntoConstraints="NO" id="LvJ-FP-Yc1">
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
<constraint firstItem="Xzr-zM-E25" firstAttribute="top" secondItem="nBP-0Q-eKB" secondAttribute="top" id="4oD-P2-9Xz"/> <constraint firstItem="Xzr-zM-E25" firstAttribute="top" secondItem="nBP-0Q-eKB" secondAttribute="top" id="4oD-P2-9Xz"/>
<constraint firstItem="Xzr-zM-E25" firstAttribute="leading" secondItem="nBP-0Q-eKB" secondAttribute="leading" id="Fci-xu-TIa"/> <constraint firstItem="Xzr-zM-E25" firstAttribute="leading" secondItem="nBP-0Q-eKB" secondAttribute="leading" id="Fci-xu-TIa"/>
<constraint firstAttribute="bottom" secondItem="LvJ-FP-Yc1" secondAttribute="bottom" constant="-1" id="SAq-Iw-I6t"/> <constraint firstAttribute="bottom" secondItem="LvJ-FP-Yc1" secondAttribute="bottom" constant="-1" id="SAq-Iw-I6t"/>
<constraint firstAttribute="height" constant="190" id="Ssh-cP-PRt"/> <constraint firstAttribute="width" secondItem="nBP-0Q-eKB" secondAttribute="height" multiplier="375:190" id="Tke-yY-EUY"/>
<constraint firstAttribute="bottom" secondItem="Xzr-zM-E25" secondAttribute="bottom" id="UhQ-tF-lG6"/> <constraint firstAttribute="bottom" secondItem="Xzr-zM-E25" secondAttribute="bottom" id="UhQ-tF-lG6"/>
<constraint firstAttribute="trailing" secondItem="Xzr-zM-E25" secondAttribute="trailing" id="dj0-cH-YiI"/> <constraint firstAttribute="trailing" secondItem="Xzr-zM-E25" secondAttribute="trailing" id="dj0-cH-YiI"/>
<constraint firstItem="LvJ-FP-Yc1" firstAttribute="centerX" secondItem="nBP-0Q-eKB" secondAttribute="centerX" id="yqu-ba-mQR"/> <constraint firstItem="LvJ-FP-Yc1" firstAttribute="centerX" secondItem="nBP-0Q-eKB" secondAttribute="centerX" id="yqu-ba-mQR"/>
...@@ -86,6 +87,5 @@ ...@@ -86,6 +87,5 @@
</objects> </objects>
<resources> <resources>
<image name="ic_triangle" width="21" height="11"/> <image name="ic_triangle" width="21" height="11"/>
<image name="test_suit" width="375" height="212"/>
</resources> </resources>
</document> </document>
...@@ -62,7 +62,10 @@ typedef enum{ ...@@ -62,7 +62,10 @@ typedef enum{
@end @end
@implementation KWMNewHomeVC @implementation KWMNewHomeVC{
CGFloat heightAdHeader;
CGFloat heightClothingSets;
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
...@@ -103,10 +106,12 @@ typedef enum{ ...@@ -103,10 +106,12 @@ typedef enum{
- (void)initView{ - (void)initView{
// self.title = @"首页"; // self.title = @"首页";
self.adHeader = [[KWMAdHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 275)]; heightAdHeader = UI_SCREEN_WIDTH * 275 / 375;
heightClothingSets = UI_SCREEN_WIDTH * 190 / 375 + 127; //127为图片外的布局高度
self.adHeader = [[KWMAdHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, heightAdHeader)];
self.menuHeader = [[KWMMenuHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 100)]; self.menuHeader = [[KWMMenuHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 100)];
self.recommendHeader = [[KWMRecommendHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 230)]; self.recommendHeader = [[KWMRecommendHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 230)];
self.clothingSetsHeader = [[KWMClothingSetsHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 317)]; self.clothingSetsHeader = [[KWMClothingSetsHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, heightClothingSets)];
self.hotSalesHeader = [[KWMHotSalesHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 250)]; self.hotSalesHeader = [[KWMHotSalesHeader alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, 250)];
self.adHeader.delegate = self; self.adHeader.delegate = self;
...@@ -262,7 +267,7 @@ typedef enum{ ...@@ -262,7 +267,7 @@ typedef enum{
NSInteger height = 0; NSInteger height = 0;
switch (section) { switch (section) {
case HeaderAd: case HeaderAd:
height = 275; height = heightAdHeader;
break; break;
case HeaderMenu: case HeaderMenu:
height = 100; height = 100;
...@@ -271,7 +276,7 @@ typedef enum{ ...@@ -271,7 +276,7 @@ typedef enum{
height = 230; height = 230;
break; break;
case HeaderClothingSets: case HeaderClothingSets:
height = 317; height = heightClothingSets;
break; break;
case HeaderHotSales: case HeaderHotSales:
height = self.hotSalesHeader.actrualHeight; height = self.hotSalesHeader.actrualHeight;
......
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