BusinessCollectionViewCell.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // BusinessCollectionViewCell.m
  3. // IBOSSmini
  4. //
  5. // Created by guan hong hou on 2017/5/3.
  6. // Copyright © 2017年 elongtian. All rights reserved.
  7. //
  8. #import "BusinessCollectionViewCell.h"
  9. @implementation BusinessCollectionViewCell
  10. /**
  11. 初始化
  12. @param frame <#frame description#>
  13. @return <#return value description#>
  14. */
  15. - (id)initWithFrame:(CGRect)frame {
  16. self = [super initWithFrame:frame];
  17. if(self){
  18. [self InitView];
  19. }
  20. return self;
  21. }
  22. /**
  23. 初始化ui
  24. */
  25. - (void)InitView
  26. {
  27. _businessImgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0,Screen_Width/4,60)];
  28. _businessImgView.contentMode = UIViewContentModeCenter;
  29. [self.contentView addSubview:_businessImgView];
  30. _businessTitleLbl = [UILabel new];
  31. _businessTitleLbl.frame=CGRectMake(0,CGRectGetMaxY(_businessImgView.frame)+5,Screen_Width/4, 25);
  32. _businessTitleLbl.font = [UIFont systemFontOfSize:13];
  33. _businessTitleLbl.textAlignment = NSTextAlignmentCenter;
  34. _businessTitleLbl.textColor = [UIColor blackColor];
  35. [self.contentView addSubview:_businessTitleLbl];
  36. }
  37. /**
  38. 设定model
  39. @param model <#model description#>
  40. */
  41. -(void) setBusinessInfoModel:(BusinessModel *)model{
  42. [_businessImgView setImage:[UIImage imageNamed:model.imageName]];
  43. _businessTitleLbl.text=model.imageTitle;
  44. }
  45. @end