CarCollectionViewCell.m 1007 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // CarCollectionViewCell.m
  3. // FanweApp
  4. //
  5. // Created by 志刚杨 on 2017/12/14.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "CarCollectionViewCell.h"
  9. @implementation CarCollectionViewCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. -(void)setSelected:(BOOL)selected
  15. {
  16. [super setSelected:selected];
  17. if (selected) {
  18. //选中时
  19. self.layer.borderColor = [UIColor orangeColor].CGColor;
  20. self.layer.borderWidth = 2;
  21. }else{
  22. //非选中
  23. // self.layer.borderColor = KHighlight.CGColor;
  24. self.layer.borderWidth = 0;
  25. }
  26. }
  27. -(void)setModel:(CarItemModel *)model
  28. {
  29. _model = model;
  30. [self.carpic sd_setImageWithURL:[NSURL URLWithString:model.thumb] placeholderImage:[UIImage imageNamed:@"no_pic"]];
  31. self.carname.text = model.name;
  32. self.carcoin.text = model.money;
  33. self.exp.text = [NSString stringWithFormat:ASLocalizedString(@"%@经验值"), model.experience];
  34. }
  35. @end