12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- //
- // ZBUserInfoListCell.m
- // ZBProject
- //
- // Created by 学丽 on 2019/5/6.
- // Copyright © 2019 ZB. All rights reserved.
- //
- #import "ZBUserInfoListCell.h"
- @implementation ZBUserInfoListCell
- -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
-
- [self addSubview:self.titleLabel];
- [self addSubview:self.rightLabel];
- [self addSubview:self.headImg];
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(10);
- make.width.mas_equalTo(70); make.height.mas_equalTo(self.mas_height);
-
- }];
- [self.headImg mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.titleLabel.mas_right).offset(25);
- make.top.mas_equalTo(5);
- make.width.height.mas_equalTo(self.mas_height).offset(-10);
- make.bottom.mas_equalTo(-5);
- }];
- [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.titleLabel.mas_right).offset(25);
- make.height.mas_equalTo(self.mas_height);
- }];
-
- UIImageView *linev =[[UIImageView alloc]init];
- linev.backgroundColor=[UIColor backgroudColor];
- [self addSubview:linev];
- [linev mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(10);
- make.right.mas_equalTo(-10);
- make.bottom.mas_equalTo(-1);
- make.height.mas_equalTo(1);
- }];
- }
- return self;
- }
- -(void)setDics:(NSDictionary *)dics
- {
- _dics = dics;
- if ([dics[@"name"]isEqualToString:@"我的头像"]) {
- self.rightLabel.hidden=YES;
- self.headImg.hidden=NO;
-
- }else{
- self.rightLabel.hidden=NO;
- self.headImg.hidden=YES;
- }
- self.titleLabel.text=dics[@"name"];
- self.rightLabel.text=dics[@"content"];
-
- }
- -(UIImageView *)headImg
- {
- if (!_headImg) {
- _headImg=[[UIImageView alloc]init];
- _headImg.layer.cornerRadius=23.5;
- _headImg.layer.masksToBounds=YES;
- }
- return _headImg;
- }
- -(UILabel *)titleLabel
- {
- if (!_titleLabel) {
- _titleLabel =[[UILabel alloc]init];
- _titleLabel.text=@"我的手机号";
- _titleLabel.textColor=[UIColor YHColorWithHex:0x3E3E3E];
- _titleLabel.font=[UIFont systemFontOfSize:16];
-
- }
- return _titleLabel;
- }
- -(UILabel *)rightLabel
- {
- if (!_rightLabel) {
- _rightLabel =[[UILabel alloc]init];
- _rightLabel.text=[AccountTool account].phone;
- _rightLabel.textColor=[UIColor YHColorWithHex:0x999999];
- _rightLabel.font=[UIFont systemFontOfSize:14];
- }
- return _rightLabel;
- }
- @end
|