diff --git a/DLWeiboProfileController/.DS_Store b/DLWeiboProfileController/.DS_Store index 1905cf4..9ae2146 100644 Binary files a/DLWeiboProfileController/.DS_Store and b/DLWeiboProfileController/.DS_Store differ diff --git a/DLWeiboProfileController/DLWeiboProfileController.xcworkspace/xcuserdata/ft_david.xcuserdatad/UserInterfaceState.xcuserstate b/DLWeiboProfileController/DLWeiboProfileController.xcworkspace/xcuserdata/ft_david.xcuserdatad/UserInterfaceState.xcuserstate index 3497aab..58348a7 100644 Binary files a/DLWeiboProfileController/DLWeiboProfileController.xcworkspace/xcuserdata/ft_david.xcuserdatad/UserInterfaceState.xcuserstate and b/DLWeiboProfileController/DLWeiboProfileController.xcworkspace/xcuserdata/ft_david.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar-1.imageset/Contents.json b/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar-1.imageset/Contents.json new file mode 100644 index 0000000..dce1e0c --- /dev/null +++ b/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar-1.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "userAvatar.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar-1.imageset/userAvatar.png b/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar-1.imageset/userAvatar.png new file mode 100644 index 0000000..0af7cb2 Binary files /dev/null and b/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar-1.imageset/userAvatar.png differ diff --git a/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar.imageset/Contents.json b/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar.imageset/Contents.json new file mode 100644 index 0000000..dce1e0c --- /dev/null +++ b/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "userAvatar.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar.imageset/userAvatar.png b/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar.imageset/userAvatar.png new file mode 100644 index 0000000..dc55a81 Binary files /dev/null and b/DLWeiboProfileController/DLWeiboProfileController/Assets.xcassets/userAvatar.imageset/userAvatar.png differ diff --git a/DLWeiboProfileController/DLWeiboProfileController/View/DLUserHeaderView.m b/DLWeiboProfileController/DLWeiboProfileController/View/DLUserHeaderView.m index 36c9133..58e7957 100644 --- a/DLWeiboProfileController/DLWeiboProfileController/View/DLUserHeaderView.m +++ b/DLWeiboProfileController/DLWeiboProfileController/View/DLUserHeaderView.m @@ -12,6 +12,7 @@ @interface DLUserHeaderView() +@property (weak, nonatomic) IBOutlet UIImageView *userAvatarImageView; @@ -24,6 +25,15 @@ +(DLUserHeaderView *)userHeaderView return [[[NSBundle mainBundle] loadNibNamed:@"DLUserHeaderView" owner:nil options:nil] firstObject]; } +-(void)awakeFromNib +{ + [super awakeFromNib]; + self.userAvatarImageView.layer.cornerRadius = 80 / 2.0; + self.userAvatarImageView.layer.borderWidth = 1; + self.userAvatarImageView.layer.borderColor = [UIColor whiteColor].CGColor; + self.userAvatarImageView.layer.masksToBounds = YES; +} + - (IBAction)tapOnImageView:(id)sender { if (self.delegate && [self.delegate respondsToSelector:@selector(userHeaderViewButtonDidClick:)]) { [self.delegate userHeaderViewButtonDidClick:self]; diff --git a/DLWeiboProfileController/DLWeiboProfileController/View/DLUserHeaderView.xib b/DLWeiboProfileController/DLWeiboProfileController/View/DLUserHeaderView.xib index 29ddcef..def15c2 100644 --- a/DLWeiboProfileController/DLWeiboProfileController/View/DLUserHeaderView.xib +++ b/DLWeiboProfileController/DLWeiboProfileController/View/DLUserHeaderView.xib @@ -12,62 +12,59 @@ - + - - + + - - - - - - - - + + + + + - - - - - - - - - - + + - + + - - - + + + + + + + + + + @@ -76,9 +73,10 @@ + - + @@ -87,6 +85,7 @@ - + + diff --git a/DLWeiboProfileController/DLWeiboProfileController/View/DLUserPageNavBar.m b/DLWeiboProfileController/DLWeiboProfileController/View/DLUserPageNavBar.m index 9c67c05..44b5ae5 100644 --- a/DLWeiboProfileController/DLWeiboProfileController/View/DLUserPageNavBar.m +++ b/DLWeiboProfileController/DLWeiboProfileController/View/DLUserPageNavBar.m @@ -55,7 +55,7 @@ -(void)setDl_alpha:(CGFloat)dl_alpha { _dl_alpha = dl_alpha; self.backImageView.alpha = dl_alpha; - self.nameLabel.hidden = !(dl_alpha >= 1.0); + self.nameLabel.hidden = !(dl_alpha >= 0.99); } diff --git a/DLWeiboProfileController/DLWeiboProfileController/ViewController/PersonalCenterController.m b/DLWeiboProfileController/DLWeiboProfileController/ViewController/PersonalCenterController.m index b473761..867ddac 100644 --- a/DLWeiboProfileController/DLWeiboProfileController/ViewController/PersonalCenterController.m +++ b/DLWeiboProfileController/DLWeiboProfileController/ViewController/PersonalCenterController.m @@ -91,7 +91,7 @@ -(void)dl_uiConfig self.userHeaderView = [DLUserHeaderView userHeaderView]; self.userHeaderView.delegate = self; - self.userHeaderView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH / 1.34 ); + self.userHeaderView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH / 1.7); _stretchableTableHeaderView = [HFStretchableTableHeaderView new]; [_stretchableTableHeaderView stretchHeaderForTableView:self.tableView withView:self.userHeaderView]; } @@ -177,9 +177,10 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView { //计算导航栏的透明度 CGFloat minAlphaOffset = 0; - CGFloat maxAlphaOffset = SCREEN_WIDTH / 1.34 - 64; + CGFloat maxAlphaOffset = SCREEN_WIDTH / 1.7 - 64; CGFloat offset = scrollView.contentOffset.y; CGFloat alpha = (offset - minAlphaOffset) / (maxAlphaOffset - minAlphaOffset); + NSLog(@"alpha--%f",alpha); self.userPageNavBar.dl_alpha = alpha;