| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- //
- // ReviseHeadCell.m
- // jitao
- //
- // Created by 罗云飞 on 2017/12/7.
- // Copyright © 2017年 罗云飞. All rights reserved.
- //
- #import "ReviseHeadCell.h"
- @implementation ReviseHeadCell
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
-
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- _headimage = [UIImageView new];
- // _headimage.backgroundColor = NewRedColor;
- ViewRadius(_headimage, fitScreenWidth(53)/2);
- [self.contentView addSubview:_headimage];
-
- _headimage.sd_layout
- .widthIs(fitScreenWidth(53))
- .heightIs(fitScreenWidth(53))
- .topSpaceToView(self.contentView, fitScreenWidth(10))
- .centerXEqualToView(self.contentView);
-
- _reviseheadlabel = [UILabel new];
- _reviseheadlabel.font = NewFont(12);
- _reviseheadlabel.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [_reviseheadlabel setSingleLineAutoResizeWithMaxWidth:0];
- [self.contentView addSubview:_reviseheadlabel];
-
- _reviseheadlabel.sd_layout
- .centerXEqualToView(self.contentView)
- .topSpaceToView(_headimage, fitScreenWidth(2))
- .heightIs(13);
-
- }
- return self;
- }
- - (void)assignment:(NSString *)nickname headimageurl:(NSString *)imageurl {
- if([nickname isEqual:[NSNull null]]) {
- _reviseheadlabel.text = @"";
- }else{
- _reviseheadlabel.text = nickname;
- }
- [_headimage sd_setImageWithURL:NewURL([imageurl mosaicUrlPrefix]) placeholderImage:NewImageNamed(@"用户头像默认")];
- }
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|