| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- //
- // BusinessCell.m
- // jitao
- //
- // Created by 罗云飞 on 2017/12/24.
- // Copyright © 2017年 罗云飞. All rights reserved.
- //
- #import "BusinessCell.h"
- @implementation BusinessCell
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
-
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
-
- UILabel *line = [UILabel new];
- line.backgroundColor = NewLineGrayColor;
- [self.contentView addSubview:line];
-
- line.sd_layout
- .leftEqualToView(self.contentView)
- .heightIs(10)
- .rightEqualToView(self.contentView)
- .topEqualToView(self.contentView);
-
- _image = [UIImageView new];
- [_image setImage:[UIImage imageNamed:@"dd"]];
- [self.contentView addSubview:_image];
-
- _image.sd_layout
- .heightIs(fitScreenWidth(14))
- .widthIs(fitScreenHeight(18))
- .leftSpaceToView(self.contentView, 15)
- .topSpaceToView(line, fitScreenWidth(15));
-
- _title = [UILabel new];
- _title.text = @"科技爱好是否看见啊还是开发撒娇话费卡萨";
- _title.font = NewFont(fitScreenWidth(14));
- _title.textColor = [UIColor colorWithString:@"#3C3C3C"];
- _title.numberOfLines = 1;
- _title.lineBreakMode = NSLineBreakByTruncatingTail;
- [self.contentView addSubview:_title];
-
- _title.sd_layout
- .leftSpaceToView(_image, 10)
- .heightIs(fitScreenWidth(44))
- .topSpaceToView(line, 0)
- .rightSpaceToView(self.contentView, fitScreenWidth(130));
-
- _time = [UILabel new];
- _time.text = [NSString stringWithFormat:@"%@",@"2018-11-11 8:00"];
- _time.font = NewFont(fitScreenWidth(12));
- _time.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [_time setSingleLineAutoResizeWithMaxWidth:0];
- [self.contentView addSubview:_time];
-
- _time.sd_layout
- .rightSpaceToView(self.contentView, 15)
- .heightIs(fitScreenWidth(44))
- .topSpaceToView(line, 0);
-
- UILabel *line1 = [UILabel new];
- line1.backgroundColor = NewLineGrayColor;
- [self.contentView addSubview:line1];
-
- line1.sd_layout
- .leftEqualToView(self.contentView)
- .heightIs(0.8)
- .rightEqualToView(self.contentView)
- .topSpaceToView(line, fitScreenHeight(44));
-
-
- _ordernumber = [UILabel new];
- _ordernumber.text = [NSString stringWithFormat:@"订单编号:%@",@"1231321"];
- _ordernumber.font = NewFont(fitScreenWidth(13));
- _ordernumber.textColor = [UIColor colorWithString:@"#FF8523"];
- [_ordernumber setSingleLineAutoResizeWithMaxWidth:0];
- [self.contentView addSubview:_ordernumber];
-
- _ordernumber.sd_layout
- .leftEqualToView(_image)
- .heightIs(fitScreenWidth(44))
- .topSpaceToView(line1, 0);
-
- _expenditure = [UILabel new];
- _expenditure.text = [NSString stringWithFormat:@"支出:¥%@",@"1231321"];
- _expenditure.font = NewFont(fitScreenWidth(13));
- _expenditure.textColor = [UIColor colorWithString:@"#158CD8"];
- [_expenditure setSingleLineAutoResizeWithMaxWidth:0];
- [self.contentView addSubview:_expenditure];
-
- _expenditure.sd_layout
- .leftSpaceToView(_ordernumber, fitScreenWidth(26))
- .heightIs(fitScreenWidth(44))
- .topSpaceToView(line1, 0);
-
- }
- return self;
- }
- - (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
|