1111111
//
// + (instancetype)cellWithTableView:(UITableView *)tableView
//{
//? ? static NSString *identifier = @"status";
//? ? ? ? // 1.緩存中取
//? ? WaitFollowCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
//? ? // 2.創建
//? ? ? ? if (cell == nil) {
// ? ? ? ? ? ? ? ? cell = [[WaitFollowCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
//? ? ? ? ? ? }
//? ? ? ? return cell;
// ? ? }
?
- (void)awakeFromNib {
? ? [super awakeFromNib];
? ? // Initialization code
??
}
?
?
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
? ? self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
? ? if (self) {
?? ? ? ?
//? ? ? ? ? ? self.nameLabel=[[UILabel alloc]initWithFrame:CGRectMake(10,15,80,24)];
//? ? ? ? ? ? self.nameLabel.textAlignment=NSTextAlignmentLeft;
//? ? ? ? ? ? self.nameLabel.font=[UIFont systemFontOfSize:18];
//? ? ? ? ? ? [self.contentView addSubview:self.nameLabel];
// ? ? ? ? ? ?
//? ? ? ? ? ? _headImageview = [[UIImageView alloc]initWithFrame:CGRectMake(14, 7, 54, 54)];
//? ? ? ? ? ? _headImageview.backgroundColor = [UIColor redColor];
//? ? ? ? ? ? _headImageview.layer.masksToBounds = YES;
//? ? ? ? ? ? _headImageview.layer.cornerRadius = 27;
//? ? ? ? ? ? [self.contentView addSubview:_headImageview];
// ? ? ? ?
//? ? ? ? ? ? _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_headImageview.frame)+10, 26, SCREEN_WIDTH-165, 20)];
//? ? ? ? ? ? _nameLabel.backgroundColor = [UIColor purpleColor];
//? ? ? ? ? ? _nameLabel.font = [UIFont systemFontOfSize:16.0];
//? ? ? ? ? ? [self.contentView addSubview:_nameLabel];
// ? ? ? ?
//? ? ? ? ? ? _revokeLabel = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-84, 12, 70, 20)];
//? ? ? ? ? ? _revokeLabel.centerY = _nameLabel.centerY;
//? ? ? ? ? ? _revokeLabel.backgroundColor = [UIColor lightGrayColor];
//? ? ? ? ? ? _revokeLabel.font = [UIFont systemFontOfSize:14.0];
//? ? ? ? ? ? [self.contentView addSubview:_revokeLabel];
?? ? ? ?
?? ? ? ? ? ?
?? ? ? ?
? ? }
?? ?
? ? return self;
}
?
?
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
? ? [super setSelected:selected animated:animated];
? ? //???2016
//? ? self.backgroundColor = [UIColor yellowColor];
//? ? _headImageview = [[UIImageView alloc]initWithFrame:CGRectMake(14, 7, 54, 54)];
//? ? _headImageview.backgroundColor = [UIColor redColor];
//? ? _headImageview.layer.masksToBounds = YES;
//? ? _headImageview.layer.cornerRadius = 27;
//? ? [self.contentView addSubview:_headImageview];
// ? ?
//? ? _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_headImageview.frame)+10, 26, SCREEN_WIDTH-165, 20)];
//? ? _nameLabel.backgroundColor = [UIColor purpleColor];
//? ? _nameLabel.font = [UIFont systemFontOfSize:16.0];
//? ? [self.contentView addSubview:_nameLabel];
// ? ?
//? ? _revokeLabel = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-84, 12, 70, 20)];
//? ? _revokeLabel.centerY = _nameLabel.centerY;
//? ? _revokeLabel.backgroundColor = [UIColor lightGrayColor];
//? ? _revokeLabel.font = [UIFont systemFontOfSize:14.0];
//? ? [self.contentView addSubview:_revokeLabel];
?? ?
}
?
?
//- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
//{
//? ? self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
//? ? if (self) {
//? ? ? ? self.backgroundColor = [UIColor yellowColor];
//? ? ? ? _headImageview = [[UIImageView alloc]init];
//? ? ? ? _headImageview.backgroundColor = [UIColor redColor];
//? ? ? ? [self.contentView addSubview:_headImageview];
// ? ? ? ?
//? ? ? ? _nameLabel = [[UILabel alloc]init];
//? ? ? ? _nameLabel.backgroundColor = [UIColor purpleColor];
//? ? ? ? [self.contentView addSubview:_nameLabel];
// ? ? ? ?
//? ? ? ? _revokeLabel = [[UILabel alloc]init];
//? ? ? ? _revokeLabel.backgroundColor = [UIColor lightGrayColor];
//? ? ? ? [self.contentView addSubview:_revokeLabel];
// ? ? ? ?
//? ? }
//? ? return self;
//}
//
當父容器的frame發生改變時,會調用該方法,常常用來設置子控件的fram值
//-(void)layoutSubviews{
// ? ?
//? ? //這里一定要先調用父類的方法,否則你會很痛苦T_T
//? ? [super layoutSubviews];
// ? ?
//? ? _headImageview.frame = CGRectMake(14, 7, 54, 54);
//? ? _headImageview.layer.masksToBounds = YES;
//? ? _headImageview.layer.cornerRadius = 27;
// ? ?
//? ? _nameLabel.frame = CGRectMake(CGRectGetMaxX(_headImageview.frame)+10, 26, SCREEN_WIDTH-165, 20);
//? ? _nameLabel.font = [UIFont systemFontOfSize:16.0];
// ? ?
//? ? _revokeLabel.frame = CGRectMake(SCREEN_WIDTH-84, 12, 70, 20);
//? ? _revokeLabel.centerY = _nameLabel.centerY;
//? ? _revokeLabel.font = [UIFont systemFontOfSize:14.0];
//
//}
?
?
- (id)initWithFrame:(CGRect)frame
{
? ? self = [super initWithFrame:frame];
? ? if (self) {
? ? ? ? self.backgroundColor = RGB(239, 239, 239);//[UIColor blueColor];
? ? ? ? _headImageview = [[UIImageView alloc]initWithFrame:CGRectMake(14, 7, 54, 54)];
? ? ? ? _headImageview.backgroundColor = [UIColor redColor];
? ? ? ? _headImageview.layer.masksToBounds = YES;
? ? ? ? _headImageview.layer.cornerRadius = 27;
? ? ? ? [self.contentView addSubview:_headImageview];
?? ? ? ?
? ? ? ? _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_headImageview.frame)+10, 26, SCREEN_WIDTH-165, 20)];
? ? ? ? _nameLabel.backgroundColor = [UIColor purpleColor];
? ? ? ? _nameLabel.font = [UIFont systemFontOfSize:16.0];
? ? ? ? [self.contentView addSubview:_nameLabel];
?? ? ? ?
? ? ? ? _revokeLabel = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-84, 12, 70, 20)];
? ? ? ? _revokeLabel.centerY = _nameLabel.centerY;
? ? ? ? _revokeLabel.backgroundColor = [UIColor lightGrayColor];
? ? ? ? _revokeLabel.font = [UIFont systemFontOfSize:14.0];
? ? ? ? [self.contentView addSubview:_revokeLabel];
? ? }
? ? return self;
}
轉載于:https://www.cnblogs.com/gzz2016/p/6070328.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
- 上一篇: 怎么除螨虫?
- 下一篇: 老公姓项,我姓曾,怎么组微信名?