-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserView.m
46 lines (33 loc) · 1.07 KB
/
UserView.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// UserView.m
// HWWeibo
//
// Created by gj on 15/8/28.
// Copyright (c) 2015年 www.huiwen.com 杭州汇文教育. All rights reserved.
//
#import "UserView.h"
#import "UIImageView+WebCache.h"
@implementation UserView
- (void)setWeiboModel:(WeiboModel *)weiboModel {
if (_weiboModel != weiboModel) {
_weiboModel = weiboModel;
[self setNeedsLayout];
}
}
- (void)layoutSubviews {
[super layoutSubviews];
_userImageView.layer.borderColor = [UIColor whiteColor].CGColor;
_userImageView.layer.borderWidth = 1;
_userImageView.layer.cornerRadius = _userImageView.width/2;
_userImageView.layer.masksToBounds = YES;
//1.用户头像
NSString *imgURL = self.weiboModel.userModel.avatar_large;
[_userImageView sd_setImageWithURL:[NSURL URLWithString:imgURL]];
//2.昵称
_nameLabel.text = self.weiboModel.userModel.screen_name;
//3.发布时间
// _createLabel.text = [UIUtils fomateString:self.weiboModel.createDate];
//4.来源
_sourceLabel.text = self.weiboModel.source;
}
@end