fix 首页

This commit is contained in:
lianxiang
2018-09-13 23:42:18 +08:00
parent 7d0027f58d
commit fada68d22d
62 changed files with 860 additions and 158 deletions
+7 -9
View File
@@ -17,15 +17,13 @@
- (void)loadCellData:(NSIndexPath *)indexPath{
if(indexPath.section == 1 && indexPath.row == 0){
self.listImageView.image = [UIImage imageNamed:@""];
self.descLabel.text = @"历史记录";
}else{
self.listImageView.image = [UIImage imageNamed:@""];
self.descLabel.text = @"系统设置";
}
NSArray *arr =@[@"历史记录",@"历史测试",@"系统设置"];
NSArray *imageName = @[@"user_history",@"user_test",@"user_setup"];
self.descLabel.text = arr[indexPath.row];
self.listImageView.image = [UIImage imageNamed:imageName[indexPath.row]];
}
+23 -12
View File
@@ -12,43 +12,51 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="GiGaMineInfoViewCell" id="KGk-i7-Jjw" customClass="GiGaMineInfoViewCell">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="GiGaMineInfoViewCell" id="KGk-i7-Jjw" customClass="GiGaMineInfoViewCell">
<rect key="frame" x="0.0" y="0.0" width="375" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="341" height="53.5"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="53.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="uc2-z4-fOE">
<rect key="frame" x="16" y="11" width="35" height="32"/>
<color key="backgroundColor" red="0.19215686269999999" green="0.81960784310000001" blue="0.76470588240000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="uc2-z4-fOE">
<rect key="frame" x="16" y="15" width="22.5" height="23"/>
<constraints>
<constraint firstAttribute="width" constant="35" id="7VO-cv-XQj"/>
<constraint firstAttribute="height" constant="32" id="zDE-yt-1Bb"/>
<constraint firstAttribute="width" constant="22.5" id="7VO-cv-XQj"/>
<constraint firstAttribute="height" constant="23" id="zDE-yt-1Bb"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uAa-YI-Wvr">
<rect key="frame" x="71" y="16" width="26" height="21"/>
<rect key="frame" x="53" y="16.5" width="25.5" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="wKB-tA-m3l"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="14"/>
<color key="textColor" red="0.21568627450980393" green="0.21568627450980393" blue="0.21568627450980393" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="O4K-t3-KxB">
<rect key="frame" x="0.0" y="53" width="375" height="1"/>
<rect key="frame" x="0.0" y="53" width="409" height="1"/>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="lgP-Cy-DDC"/>
</constraints>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_indicator_right" translatesAutoresizingMaskIntoConstraints="NO" id="zO5-UY-SQP">
<rect key="frame" x="343" y="20" width="8.5" height="14"/>
<constraints>
<constraint firstAttribute="width" constant="8.5" id="84f-qF-Loo"/>
<constraint firstAttribute="height" constant="14" id="D5i-qd-Y9A"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstItem="O4K-t3-KxB" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="4HX-Qq-cv3"/>
<constraint firstItem="uc2-z4-fOE" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="5qg-HZ-06o"/>
<constraint firstAttribute="trailing" secondItem="O4K-t3-KxB" secondAttribute="trailing" constant="-34" id="Nad-rR-L6i"/>
<constraint firstItem="uAa-YI-Wvr" firstAttribute="leading" secondItem="uc2-z4-fOE" secondAttribute="trailing" constant="20" id="PO3-lw-pzh"/>
<constraint firstItem="uAa-YI-Wvr" firstAttribute="leading" secondItem="uc2-z4-fOE" secondAttribute="trailing" constant="14.5" id="PO3-lw-pzh"/>
<constraint firstItem="zO5-UY-SQP" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" constant="0.25" id="ZCK-2M-1bz"/>
<constraint firstAttribute="trailing" secondItem="zO5-UY-SQP" secondAttribute="trailing" constant="23.5" id="b2w-5h-Oei"/>
<constraint firstAttribute="bottom" secondItem="O4K-t3-KxB" secondAttribute="bottom" constant="-0.5" id="kHp-np-2YA"/>
<constraint firstItem="uAa-YI-Wvr" firstAttribute="centerY" secondItem="uc2-z4-fOE" secondAttribute="centerY" id="sn9-aQ-jMo"/>
<constraint firstItem="uc2-z4-fOE" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="ugC-g4-MrU"/>
@@ -62,4 +70,7 @@
<point key="canvasLocation" x="33.5" y="75"/>
</tableViewCell>
</objects>
<resources>
<image name="user_indicator_right" width="9" height="14"/>
</resources>
</document>
@@ -7,7 +7,13 @@
//
#import <UIKit/UIKit.h>
#import "GiGaUser.h"
@interface GiGaMineUserViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *userAvator;
@property (weak, nonatomic) IBOutlet UILabel *userName;
@property (weak, nonatomic) IBOutlet UIButton *vipLabe;
-(void)loadUserinfoWith:(GiGaUser *)user;
@end
@@ -8,12 +8,34 @@
//我的 - 个人中心cell
#import "GiGaMineUserViewCell.h"
#import "UIImageView+WebCache.h"
@implementation GiGaMineUserViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.vipLabe.layer.masksToBounds = YES;
self.vipLabe.layer.cornerRadius = self.vipLabe.frame.size.height /2;
self.vipLabe.layer.borderWidth = 1;
self.vipLabe.layer.borderColor = [UIColor whiteColor].CGColor;
self.userAvator.layer.masksToBounds = YES;
self.userAvator.layer.cornerRadius = self.userAvator.frame.size.height /2 ;
}
-(void)loadUserinfoWith:(GiGaUser *)user{
if (user.headImgUrl && ![user.nickName isKindOfClass:[NSNull class]]) {
[self.userAvator sd_setImageWithURL:[NSURL URLWithString:user.headImgUrl]];
}
if (!user.nickName && ![user.nickName isKindOfClass:[NSNull class]]) {
self.userName.text = user.nickName;
}else{
self.userName.text = @"GIGAUser666";
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+50 -16
View File
@@ -12,35 +12,69 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="GiGaMineUserViewCell" id="KGk-i7-Jjw" customClass="GiGaMineUserViewCell">
<rect key="frame" x="0.0" y="0.0" width="375" height="180"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="GiGaMineUserViewCell" id="KGk-i7-Jjw" customClass="GiGaMineUserViewCell">
<rect key="frame" x="0.0" y="0.0" width="375" height="139"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="341" height="179.5"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="138.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="enF-Ff-Ve5">
<rect key="frame" x="16" y="32" width="78" height="83"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.34901960780000002" blue="0.094117647060000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_circle_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="enF-Ff-Ve5">
<rect key="frame" x="21" y="33.5" width="72" height="72"/>
<constraints>
<constraint firstAttribute="width" constant="72" id="0cV-T2-hjs"/>
<constraint firstAttribute="height" constant="72" id="Jry-ab-5Rb"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="用户名" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ljK-NJ-5JM">
<rect key="frame" x="115" y="45" width="52" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="用户名" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ljK-NJ-5JM">
<rect key="frame" x="108" y="45" width="36" height="17"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="WSz-1q-Smh"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8KQ-fZ-Z5e">
<rect key="frame" x="115" y="85" width="80" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8KQ-fZ-Z5e">
<rect key="frame" x="108" y="70" width="54" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="54" id="PMb-11-KnL"/>
<constraint firstAttribute="height" constant="20" id="wk4-Kh-bq7"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="10"/>
<state key="normal" title="VIP会员"/>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_indicator_white" translatesAutoresizingMaskIntoConstraints="NO" id="Cuw-j9-gym">
<rect key="frame" x="343" y="62" width="8.5" height="14"/>
<constraints>
<constraint firstAttribute="height" constant="14" id="P9r-33-wNp"/>
<constraint firstAttribute="width" constant="8.5" id="lm3-q9-BlG"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstItem="ljK-NJ-5JM" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="45" id="7kC-vE-DJc"/>
<constraint firstAttribute="trailing" secondItem="Cuw-j9-gym" secondAttribute="trailing" constant="23.5" id="8Ul-7Z-RhI"/>
<constraint firstItem="8KQ-fZ-Z5e" firstAttribute="leading" secondItem="enF-Ff-Ve5" secondAttribute="trailing" constant="15" id="Kc6-B5-AxT"/>
<constraint firstItem="enF-Ff-Ve5" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="21" id="Ktw-Wr-D0J"/>
<constraint firstItem="8KQ-fZ-Z5e" firstAttribute="top" secondItem="ljK-NJ-5JM" secondAttribute="bottom" constant="8" id="X7c-Mw-8Kp"/>
<constraint firstItem="Cuw-j9-gym" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" constant="-0.25" id="sd7-cN-yU2"/>
<constraint firstItem="ljK-NJ-5JM" firstAttribute="leading" secondItem="enF-Ff-Ve5" secondAttribute="trailing" constant="15" id="ut9-G8-edt"/>
<constraint firstItem="enF-Ff-Ve5" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="yPC-Eg-YqT"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" red="0.51372549019607838" green="0.039215686274509803" blue="0.039215686274509803" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<point key="canvasLocation" x="33.5" y="75"/>
<connections>
<outlet property="userAvator" destination="enF-Ff-Ve5" id="Uf2-hS-TtN"/>
<outlet property="userName" destination="ljK-NJ-5JM" id="p0c-zb-CTC"/>
<outlet property="vipLabe" destination="8KQ-fZ-Z5e" id="lf1-k7-E7T"/>
</connections>
<point key="canvasLocation" x="33.5" y="74.5"/>
</tableViewCell>
</objects>
<resources>
<image name="img_circle_avatar" width="114" height="114"/>
<image name="user_indicator_white" width="9" height="14"/>
</resources>
</document>