ILabel alloc] init]; sourceLabel.font = HWStatusCellSourceFont; [originalView addSubview:sourceLabel]; self.sourceLabel = sourceLabel; /** 正文 */ UILabel *contentLabel = [[UILabel alloc] init]; contentLabel.font = HWStatusCellContentFont; contentLabel.numberOfLines = 0; [originalView addSubview:contentLabel]; self.contentLabel = contentLabel; } return self; }
// 对各个子控件 设置 Frame 和 赋值数据 - (void)setStatusFrame:(HWStatusFrame *)statusFrame { _statusFrame = statusFrame; HWStatus *status = statusFrame.status; HWUser *user = status.user; /** 原创微博整体 */ self.originalView.frame = statusFrame.originalViewF; /** 头像 */ self.iconView.frame = statusFrame.iconViewF; [self.iconView sd_setImageWithURL:[NSURL URLWithString:user.profile_image_url] placeholderImage:[UIImage imageNamed:@"avatar_default_small"]]; /** 会员图标 */ if (user.isVip) { self.vipView.hidden = NO; self.vipView.frame = statusFrame.vipViewF; NSString *vipName = [NSString stringWithFormat:@"common_icon_membership_level%d", user.mbrank]; self.vipView.image = [UIImage imageNamed:vipName]; self.nameLabel.textColor = [UIColor orangeColor]; } else { self.nameLabel.textColor = [UIColor blackColor]; self.vipView.hidden = YES; } /** 配图 */ self.photoView.frame = statusFrame.photoViewF; self.photoView.backgroundColor = [UIColor redColor]; /** 昵称 */ self.nameLabel.text = user.name; self.nameLabel.frame = statusFrame.nameLabelF; /** 时间 */ self.timeLabel.text = status.created_at; self.timeLabel.frame = statusFrame.timeLabelF; /** 来源 */ self.sourceLabel.text = status.source; self.sourceLabel.frame = statusFrame.sourceLabelF; /** 正文 */ self.contentLabel.text = status.text; self.contentL |