GameGiftCell.m 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // GameGiftCell.m
  3. // BuguLive
  4. //
  5. // Created by 王珂 on 17/4/28.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "GameGiftCell.h"
  9. @implementation GameGiftCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. self.selectedImageView.hidden = YES;
  14. self.diamondLabel.textColor = kAppGrayColor1;
  15. self.layer.cornerRadius = 3;
  16. self.layer.masksToBounds = YES;
  17. // self.giftImageView.contentMode = UIViewContentModeScaleAspectFill;
  18. // self.giftImageView.clipsToBounds = YES;
  19. }
  20. -(void)setModel:(GiftModel *)model
  21. {
  22. _model = model;
  23. self.layer.borderWidth = 1.0;
  24. if (!model.isSelected) {
  25. self.layer.borderColor = kAppSpaceColor.CGColor;
  26. }
  27. else
  28. {
  29. self.layer.borderColor = kAppGrayColor1.CGColor;
  30. }
  31. self.selectedImageView.hidden = !model.isSelected;
  32. [self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:kDefaultPreloadImgSquare];
  33. self.diamondLabel.text = [NSString stringWithFormat:@"%ld",(long)model.diamonds];
  34. }
  35. @end