| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- //
- // MessagecurrencyCell.m
- // jitao
- //
- // Created by 罗云飞 on 2017/12/18.
- // Copyright © 2017年 罗云飞. All rights reserved.
- //
- #import "MessagecurrencyCell.h"
- @implementation MessagecurrencyCell
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
-
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- _image = [UIImageView new];
- [self.contentView addSubview:_image];
- ViewRadius(_image, fitScreenWidth(44)/2);
-
- _image.sd_layout
- .leftSpaceToView(self.contentView, 10)
- .heightIs(fitScreenWidth(44))
- .widthIs(fitScreenWidth(44))
- .centerYEqualToView(self.contentView);
-
- _title = [UILabel new];
- _title.font = NewFont(fitScreenWidth(15));
- _title.textColor = NewBlackColor;
- [_title setSingleLineAutoResizeWithMaxWidth:0];
- [self.contentView addSubview:_title];
-
- _title.sd_layout
- .leftSpaceToView(_image, 8)
- .heightIs(14)
- .topSpaceToView(self.contentView, 15);
-
- _content = [UILabel new];
- _content.font = NewFont(fitScreenWidth(12));
- _content.textColor = [UIColor colorWithString:@"#9A9A9A"];
- _content.numberOfLines = 1;
- _content.lineBreakMode = NSLineBreakByTruncatingTail;
- _content.textAlignment = NSTextAlignmentLeft;
- [self.contentView addSubview:_content];
-
- _content.sd_layout
- .leftEqualToView(_title)
- .heightIs(12)
- .rightSpaceToView(self.contentView, 35)
- .bottomSpaceToView(self.contentView, 13);
-
- _time = [UILabel new];
- _time.font = NewFont(fitScreenWidth(10));
- _time.textColor = [UIColor colorWithString:@"#9A9A9A"];
- [_time setSingleLineAutoResizeWithMaxWidth:0];
- [self.contentView addSubview:_time];
-
- _time.sd_layout
- .topSpaceToView(self.contentView, 18)
- .heightIs(10)
- .rightSpaceToView(self.contentView, 15);
-
- _corner = [UILabel new];
- _corner.textColor = NewWhiteColor;
- _corner.font = NewFont(10);
- ViewRadius(_corner, 15/2);
- _corner.textAlignment = NSTextAlignmentCenter;
- [self.contentView addSubview:_corner];
-
- _corner.sd_layout
- .widthIs(15)
- .heightIs(15)
- .rightSpaceToView(self.contentView, 15)
- .bottomSpaceToView(self.contentView, 15);
-
- UILabel *line = [UILabel new];
- line.backgroundColor = NewLineGrayColor;
- [self.contentView addSubview:line];
-
- line.sd_layout
- .leftEqualToView(self.contentView)
- .rightEqualToView(self.contentView)
- .heightIs(0.8)
- .bottomEqualToView(self.contentView);
-
- /*
- */
-
- }
- return self;
- }
- - (void)assignment:(TaoXinModel *)model {
- [_image setImage:[UIImage imageNamed:@"系统消息"]];
- [_title setText:model.sysMessageTitle];
- _time.text = model.sysMessageDate;
- if ([model.sysMessageUnRead integerValue] >99) {
- _corner.text = @"N+";
- }else{
- _corner.text = model.sysMessageUnRead;
- }
-
- }
- - (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
|