MsgSysCell.m 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // MsgSysCell.m
  3. // YBVideo
  4. //
  5. // Created by YunBao on 2018/8/3.
  6. // Copyright © 2018年 cat. All rights reserved.
  7. //
  8. #import "MsgSysCell.h"
  9. @implementation MsgSysCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. }
  13. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  14. [super setSelected:selected animated:animated];
  15. }
  16. -(void)setIsWhiteStyle:(BOOL)isWhiteStyle {
  17. _isWhiteStyle = isWhiteStyle;
  18. if (_isWhiteStyle) {
  19. self.backgroundColor = UIColor.whiteColor;
  20. self.contentView.backgroundColor = UIColor.whiteColor;
  21. self.lineL.backgroundColor = RGB(245, 245, 245);
  22. self.titleL.textColor = RGB_COLOR(@"#000000", 1);
  23. self.flagIV.hidden = YES;
  24. }else{
  25. self.backgroundColor = UIColor.whiteColor;
  26. self.contentView.backgroundColor = UIColor.whiteColor;
  27. }
  28. }
  29. +(MsgSysCell*)cellWithTab:(UITableView *)tableView andIndexPath:(NSIndexPath*)indexPath {
  30. MsgSysCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MsgSysCell"];
  31. if (!cell) {
  32. cell = [[[NSBundle mainBundle]loadNibNamed:@"MsgSysCell" owner:nil options:nil]objectAtIndex:0];
  33. }
  34. return cell;
  35. }
  36. - (void)setModel:(MsgSysModel *)model {
  37. _model = model;
  38. [_iconIV sd_setImageWithURL:[NSURL URLWithString:_model.iconStr]];
  39. _titleL.text = _model.titleStr;
  40. [_flagIV setImage:[UIImage imageNamed:getImagename(@"msg_gov")]];
  41. if ([_model.uidStr isEqual:@"dsp_admin_1"]) {
  42. _briefL.text = _model.briefStr;
  43. }else{
  44. _briefL.text = _model.contentStr;
  45. }
  46. _timeL.text = _model.timeStr;
  47. }
  48. @end