// // CollCell.m // jitao // // Created by 罗云飞 on 2018/1/18. // Copyright © 2018年 罗云飞. All rights reserved. // #import "CollCell.h" @implementation CollCell - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { _type = [UILabel new]; _type.textAlignment = NSTextAlignmentCenter; _type.font = NewFont(fitScreenWidth(12)); [self.contentView addSubview:_type]; _type.sd_layout .leftSpaceToView(self.contentView, 5) .topSpaceToView(self.contentView, 10) .heightIs(20) .rightSpaceToView(self.contentView, 5); } return self; } -(void)SetCollCellData:(NSDictionary *)model { _type.text = model[@"name"]; if ([model[@"state"] isEqualToString:@"0"]) { _type.textColor = NewButtonColor; _type.backgroundColor = NewWhiteColor; ViewBorderRadius(_type, 5, 0.6, NewButtonColor); }else{ _type.textColor = NewWhiteColor; _type.backgroundColor = NewButtonColor; ViewBorderRadius(_type, 5, 0.6, NewButtonColor); } } @end