添加关注按钮

This commit is contained in:
ylzheng
2015-10-26 22:54:15 +08:00
parent 0bda3f357f
commit 2445e60534
3 changed files with 27 additions and 6 deletions
+20
View File
@@ -272,6 +272,19 @@
<segue destination="w7v-wp-S5s" kind="embed" identifier="containerSegue" id="4te-Fb-lmL"/>
</connections>
</containerView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CNw-ot-yn7">
<rect key="frame" x="344" y="120" width="54" height="20"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="54" id="PgZ-bN-3PP"/>
<constraint firstAttribute="width" constant="54" id="zSn-fu-zbH"/>
<constraint firstAttribute="height" constant="20" id="zsA-F1-5hc"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="10"/>
<state key="normal" title="关注">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
</subviews>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
@@ -284,10 +297,13 @@
<constraint firstAttribute="centerX" secondItem="yIh-xg-eKG" secondAttribute="centerX" id="2Hf-Nw-YU2"/>
<constraint firstItem="XGc-Dl-Wje" firstAttribute="top" secondItem="yIh-xg-eKG" secondAttribute="bottom" constant="13" id="3aM-D1-2Ky"/>
<constraint firstItem="9w4-mx-yar" firstAttribute="width" secondItem="XGc-Dl-Wje" secondAttribute="width" constant="30" id="3bw-I3-osG"/>
<constraint firstItem="CNw-ot-yn7" firstAttribute="centerY" secondItem="yp4-E4-vOS" secondAttribute="centerY" id="42a-7y-0D1"/>
<constraint firstAttribute="width" secondItem="yIh-xg-eKG" secondAttribute="width" id="7Ni-RC-xNJ"/>
<constraint firstItem="CNw-ot-yn7" firstAttribute="leading" secondItem="bPm-kp-unG" secondAttribute="trailing" constant="17" id="7Pf-e5-Xaz"/>
<constraint firstAttribute="height" constant="600" id="7nl-um-KpN"/>
<constraint firstAttribute="bottom" secondItem="yIh-xg-eKG" secondAttribute="bottom" constant="450" id="9L0-St-z8R"/>
<constraint firstItem="XGc-Dl-Wje" firstAttribute="centerX" secondItem="rID-rz-Ikg" secondAttribute="centerX" id="9Nf-Tq-zrt"/>
<constraint firstItem="CNw-ot-yn7" firstAttribute="bottom" secondItem="bPm-kp-unG" secondAttribute="bottom" id="BSH-pV-N9g"/>
<constraint firstItem="9w4-mx-yar" firstAttribute="top" secondItem="XGc-Dl-Wje" secondAttribute="bottom" constant="25" id="DNe-sp-xtx"/>
<constraint firstItem="zAW-lF-yk5" firstAttribute="bottom" secondItem="bIG-eJ-I2C" secondAttribute="bottom" constant="-6" id="EV8-5N-VIc"/>
<constraint firstItem="zAW-lF-yk5" firstAttribute="leading" secondItem="Pb5-rZ-PRn" secondAttribute="trailing" constant="2" id="Hwy-aV-2lc"/>
@@ -325,6 +341,7 @@
<constraint firstItem="zAW-lF-yk5" firstAttribute="centerX" secondItem="rID-rz-Ikg" secondAttribute="centerX" id="l7d-Pw-f2I"/>
<constraint firstItem="SIX-Qg-kL0" firstAttribute="top" secondItem="XGc-Dl-Wje" secondAttribute="bottom" constant="8" id="lJd-lK-eW0"/>
<constraint firstAttribute="bottom" secondItem="9w4-mx-yar" secondAttribute="bottom" constant="33" id="ltj-P3-Zb4"/>
<constraint firstItem="CNw-ot-yn7" firstAttribute="leading" secondItem="yp4-E4-vOS" secondAttribute="trailing" constant="-9" id="m3E-WV-fnn"/>
<constraint firstItem="yp4-E4-vOS" firstAttribute="top" secondItem="bPm-kp-unG" secondAttribute="bottom" id="muU-fk-uVr"/>
<constraint firstItem="9w4-mx-yar" firstAttribute="leading" secondItem="XGc-Dl-Wje" secondAttribute="leading" constant="-15" id="nFx-po-sOi"/>
<constraint firstItem="9w4-mx-yar" firstAttribute="top" secondItem="SIX-Qg-kL0" secondAttribute="bottom" constant="2" id="nHR-xx-SFd"/>
@@ -362,6 +379,8 @@
<exclude reference="EV8-5N-VIc"/>
<exclude reference="ijC-7o-1yr"/>
<exclude reference="ZAr-BQ-eq9"/>
<exclude reference="7Pf-e5-Xaz"/>
<exclude reference="BSH-pV-N9g"/>
</mask>
</variation>
</scrollView>
@@ -401,6 +420,7 @@
<outlet property="avatarImageView" destination="bPm-kp-unG" id="LZZ-jw-LdZ"/>
<outlet property="contentView" destination="9w4-mx-yar" id="uLQ-oY-F8X"/>
<outlet property="follosNumLabel" destination="Pb5-rZ-PRn" id="zWG-Ah-wB6"/>
<outlet property="followButton" destination="CNw-ot-yn7" id="4wK-jI-9UI"/>
<outlet property="followerNumLabel" destination="dd1-LB-NAs" id="5be-gA-lvL"/>
<outlet property="nameLabel" destination="yp4-E4-vOS" id="6nz-6L-ch6"/>
<outlet property="subTitleLabel" destination="vXj-aq-evk" id="M6L-tZ-JY7"/>
+1 -1
View File
@@ -88,7 +88,7 @@ class ExploreTableViewController: UITableViewController {
targetUserName = source.title
performSegueWithIdentifier("showUserDetailsSegue", sender: self)
}
}
}
+6 -5
View File
@@ -17,6 +17,7 @@ class ProfileViewController: UIViewController{
@IBOutlet weak var follosNumLabel: UILabel!
@IBOutlet weak var avatarImageView: UIImageView!
@IBOutlet weak var contentView: UIView!
@IBOutlet weak var followButton: UIButton!
private var containerViewController: ContainerViewController!
private var screenSize: CGRect!
@@ -35,19 +36,20 @@ class ProfileViewController: UIViewController{
super.viewDidLoad()
self.navigationController?.navigationBar.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1)
self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
screenSize = UIScreen.mainScreen().bounds
screenWidth = screenSize.width
screenHeight = screenSize.height
self.avatarImageView.layer.cornerRadius = self.avatarImageView.frame.width / 2
self.avatarImageView.clipsToBounds = true
self.avatarImageView.layer.borderWidth = 2
self.avatarImageView.layer.borderColor = UIColor.whiteColor().CGColor
self.followButton.layer.borderWidth = 1
self.followButton.layer.borderColor = UIColor.whiteColor().CGColor
navigationController?.navigationBar.backgroundColor = UIColor.whiteColor()
navigationController?.navigationBar.tintColor = UIColor.whiteColor()
@@ -58,11 +60,12 @@ class ProfileViewController: UIViewController{
override func viewDidAppear(animated: Bool) {
super.viewDidDisappear(animated)
if self.isMe {
loadMeProfile()
} else{
loadUserProfile(userId!)
print(">>>> \(LocalStore.accessUserId())")
}
}
@@ -72,8 +75,6 @@ class ProfileViewController: UIViewController{
LibrxService.profile(userId) { [weak self](profile) -> () in
if let selfView = self {
print(profile.avatar)
let avatar = NSURL(string: profile.avatar)
selfView.avatarImageView.sd_setImageWithURL(avatar, placeholderImage: UIImage(named: "default"))
selfView.nameLabel.text = profile.name