97 lines
2.0 KiB
Objective-C
97 lines
2.0 KiB
Objective-C
//
|
|
// SimulationTableViewCell.m
|
|
// EscortProject
|
|
//
|
|
// Created by Apple on 2024/8/15.
|
|
//
|
|
|
|
#import "SimulationTableViewCell.h"
|
|
|
|
@interface SimulationTableViewCell ()
|
|
|
|
@property (nonatomic, strong) UILabel * usernameLable;
|
|
|
|
@property (nonatomic, strong) UILabel * realnameLabel;
|
|
|
|
@property (nonatomic, strong) UILabel * phoneLabel;
|
|
|
|
@property (nonatomic, strong) UILabel * workNoLabel;
|
|
|
|
@end
|
|
|
|
@implementation SimulationTableViewCell
|
|
|
|
|
|
- (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
|
|
}
|
|
|
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
|
|
|
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
|
|
|
[self createUI];
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
- (void)createUI {
|
|
|
|
|
|
self.usernameLable = [self createLabel:0];
|
|
[self.contentView addSubview:self.usernameLable];
|
|
|
|
self.realnameLabel = [self createLabel:self.usernameLable.right];
|
|
[self.contentView addSubview:self.realnameLabel];
|
|
|
|
self.phoneLabel = [self createLabel: self.realnameLabel.right];
|
|
[self.contentView addSubview:self.phoneLabel];
|
|
|
|
self.workNoLabel = [self createLabel: self.phoneLabel.right];
|
|
[self.contentView addSubview:self.workNoLabel];
|
|
|
|
}
|
|
|
|
- (UILabel *)createLabel:(CGFloat)x {
|
|
|
|
CGFloat labW = kScreenWidth/4;
|
|
|
|
UILabel * lab = [[UILabel alloc] initWithFrame:CGRectMake( x, 0, labW, kRealValue(44))];
|
|
|
|
lab.numberOfLines = 0;
|
|
|
|
|
|
lab.textAlignment = NSTextAlignmentCenter;
|
|
|
|
lab.font = MEDIUMFONT(13);
|
|
|
|
lab.textColor = CFontColor1;
|
|
|
|
return lab;
|
|
|
|
|
|
}
|
|
|
|
- (void)setModel:(XJMineCenterUserModel *)model {
|
|
|
|
_model = model;
|
|
self.realnameLabel.text = _model.realname;
|
|
self.workNoLabel.text = _model.workNo;
|
|
self.phoneLabel.text = _model.phone;
|
|
self.usernameLable.text = _model.username;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
@end
|