123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- //
- // IndexGoodBookCell.m
- // smartRhino
- //
- // Created by niuzhen on 2020/9/18.
- // Copyright © 2020 tederen. All rights reserved.
- //
- #import "IndexGoodBookCell.h"
- @implementation IndexGoodBookCell
- - (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
- }
- + (IndexGoodBookCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"IndexGoodBookCell0";
- IndexGoodBookCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"IndexGoodBookCell" owner:nil options:nil] objectAtIndex:0];
- }
- return cell;
- }
- + (IndexGoodBookCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"IndexGoodBookCell1";
- IndexGoodBookCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"IndexGoodBookCell" owner:nil options:nil] objectAtIndex:1];
- }
- return cell;
- }
- - (void)setDataWithModel:(HomeSubItemModel *)model searchText:(NSString *)text
- {
- [self.imgV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")];
- self.titleL.attributedText = [ZYCTool checkOfString:model.Title withSearchText:text withColor:UIColorHex(0xFF5252)];
- CGFloat height = [self.titleL sizeThatFits:CGSizeMake(SCREEN_WIDTH - 143, MAXFLOAT)].height;
- if (height > 30) {
- self.subtitleL.numberOfLines = 1;
- }else{
- self.subtitleL.numberOfLines = 2;
- }
- self.nameL.text = model.Author;
- self.subtitleL.text = model.Summary;
- }
- - (void)setDataWithModel:(BookRecommendModel *)model
- {
- [self.imgV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")];
- self.titleL.text = model.Title;
- CGFloat height = [self.titleL sizeThatFits:CGSizeMake(SCREEN_WIDTH - 143, MAXFLOAT)].height;
- if (height > 30) {
- self.subtitleL.numberOfLines = 1;
- }else{
- self.subtitleL.numberOfLines = 2;
- }
- self.nameL.text = model.Author;
- self.subtitleL.text = model.Summary;
- }
- @end
|