// // CategoryCell.m // jitao // // Created by 罗云飞 on 2017/12/7. // Copyright © 2017年 罗云飞. All rights reserved. // #import "CategoryCell.h" @implementation CategoryCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.backgroundColor = NewNavigationColor; UIView *view = [UIView new]; view.backgroundColor = NewWhiteColor; ViewRadius(view, 5); [self.contentView addSubview:view]; view.sd_layout .leftSpaceToView(self.contentView, 15) .topEqualToView(self.contentView) .heightIs(fitScreenWidth(44)) .rightSpaceToView(self.contentView, 15); _image = [UIImageView new]; // _image.backgroundColor = NewRedColor; [view addSubview:_image]; _image.sd_layout .leftSpaceToView(view, fitScreenWidth(12)) .centerYEqualToView(view) .heightIs(fitScreenWidth(16)) .widthIs(fitScreenWidth(16)); _name = [UILabel new]; _name.font = NewFont(fitScreenWidth(14)); [_name setSingleLineAutoResizeWithMaxWidth:0]; _name.textColor = NewBlackColor; [view addSubview:_name]; _name.sd_layout .leftSpaceToView(_image, 10) .centerYEqualToView(view) .heightIs(fitScreenHeight(13)); _seedetails = [UILabel new]; _seedetails.textColor = [UIColor colorWithString:@"#9A9A9A"]; _seedetails.font = NewFont(fitScreenWidth(12)); [_seedetails setSingleLineAutoResizeWithMaxWidth:0]; [view addSubview:_seedetails]; _seedetails.sd_layout .centerYEqualToView(view) .rightSpaceToView(view, 30) .heightIs(fitScreenHeight(12)); _line = [UILabel new]; _line.backgroundColor = NewLineGrayColor; [view addSubview:_line]; _line.sd_layout .bottomEqualToView(view) .leftEqualToView(view) .rightEqualToView(view) .heightIs(0.6); _backimage = [UIImageView new]; [_backimage setImage:[UIImage imageNamed:@"括号"]]; // backimage.backgroundColor = NewRedColor; [view addSubview:_backimage]; _backimage.sd_layout .rightSpaceToView(view, 15) .centerYEqualToView(view) .heightIs(fitScreenWidth(13)) .widthIs(fitScreenWidth(7)); } return self; } - (void)assignment:(NSDictionary *)model { _name.text = model[@"nameKey"]; _seedetails.text = @"查看详情"; [_image setImage:[UIImage imageNamed:model[@"imageKey"]]]; } - (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