| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- //
- // 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
|