YBDestroyCell.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // YBDestroyCell.m
  3. // YBVideo
  4. //
  5. // Created by YB007 on 2020/6/22.
  6. // Copyright © 2020 cat. All rights reserved.
  7. //
  8. #import "YBDestroyCell.h"
  9. @implementation YBDestroyCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. [_stateBtn setTitle:YZMsg(@"未通过") forState:0];
  13. [_stateBtn setTitleColor:Pink_Cor forState:0];
  14. [_stateBtn setImage:[UIImage imageNamed:@"注销-未"] forState:0];
  15. [_stateBtn setTitle:YZMsg(@"已通过") forState:UIControlStateSelected];
  16. [_stateBtn setTitleColor:RGB_COLOR(@"#ffffff", 0.61) forState:UIControlStateSelected];
  17. [_stateBtn setImage:[UIImage imageNamed:@"注销-通"] forState:UIControlStateSelected];
  18. BOOL isBoldText = [PublicObj isBlodText];
  19. if (isBoldText) {
  20. [self layoutIfNeeded];
  21. CGFloat www = _stateBtn.width;
  22. [_stateBtn mas_updateConstraints:^(MASConstraintMaker *make) {
  23. make.width.mas_equalTo(www*1.1);
  24. }];
  25. }
  26. }
  27. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  28. [super setSelected:selected animated:animated];
  29. }
  30. +(YBDestroyCell *)cellWithTab:(UITableView *)table index:(NSIndexPath *)index {
  31. YBDestroyCell *cell = [table dequeueReusableCellWithIdentifier:@"YBDestroyCell"];
  32. if (!cell) {
  33. cell = [[[NSBundle mainBundle]loadNibNamed:@"YBDestroyCell" owner:nil options:nil]objectAtIndex:0];
  34. }
  35. cell.backgroundColor = CellRow_Cor;
  36. cell.contentView.backgroundColor = CellRow_Cor;
  37. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  38. return cell;
  39. }
  40. - (void)setDataDic:(NSDictionary *)dataDic {
  41. _dataDic = dataDic;
  42. _titleL.text = minstr([_dataDic valueForKey:@"title"]);
  43. _contentL.text = minstr([_dataDic valueForKey:@"content"]);
  44. int isOk = [minstr([_dataDic valueForKey:@"is_ok"]) intValue];
  45. _stateBtn.selected = isOk;
  46. }
  47. @end