SetCell.m 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //
  2. // SetCell.m
  3. // UniversalApp
  4. //
  5. // Created by bogokj on 2019/8/5.
  6. // Copyright © 2019 voidcat. All rights reserved.
  7. //
  8. #import "SetCell.h"
  9. @interface SetCell ()
  10. @property (weak, nonatomic) IBOutlet UILabel *leftTitleLabel;
  11. @property (weak, nonatomic) IBOutlet UILabel *rightTitleLabel;
  12. @property (weak, nonatomic) IBOutlet UIButton *audioBtn;
  13. @end
  14. @implementation SetCell
  15. - (void)awakeFromNib {
  16. [super awakeFromNib];
  17. self.backgroundColor = [UIColor clearColor];
  18. self.contentView.backgroundColor = [UIColor clearColor];
  19. // Initialization code
  20. }
  21. - (void)setType:(SetCellType)type{
  22. _type = type;
  23. if (_type == SetCellTypeRoom) {
  24. self.backgroundColor = [UIColor colorWithHexString:@"1B1823"];
  25. self.leftTitleLabel.textColor = kWhiteColor;
  26. self.rightTitleLabel.textColor = [UIColor colorWithHexString:@"#A79FAE"];
  27. }
  28. }
  29. - (void)setLeftFont:(NSInteger)leftFont{
  30. _leftFont = leftFont;
  31. self.leftTitleLabel.font = [UIFont systemFontOfSize:leftFont];
  32. }
  33. - (void)setRightFont:(NSInteger)rightFont{
  34. _rightFont = rightFont;
  35. self.rightTitleLabel.font = [UIFont systemFontOfSize:rightFont];
  36. }
  37. - (void)setLeftMediumFont:(NSInteger)leftMediumFont{
  38. _leftMediumFont = leftMediumFont;
  39. self.leftTitleLabel.font = [UIFont systemFontOfSize:leftMediumFont weight:UIFontWeightMedium];
  40. }
  41. - (void)setLeftTitle:(NSString *)leftTitle{
  42. _leftTitle = leftTitle;
  43. [self.leftTitleLabel setText:leftTitle];
  44. if ([leftTitle isEqualToString:ASLocalizedString(@"退出登录")]) {
  45. [self.leftTitleLabel setTextColor:[UIColor colorWithHexString:@"#918DFE"]];
  46. }
  47. self.nextBtn.hidden = [leftTitle isEqualToString:ASLocalizedString(@"账号")];
  48. }
  49. - (void)setRightTitle:(NSString *)rightTitle{
  50. _rightTitle = rightTitle;
  51. if (rightTitle.length) {
  52. self.rightTitleLabel.hidden = NO;
  53. [self.rightTitleLabel setText:rightTitle];
  54. }
  55. if ([_leftTitle isEqualToString:ASLocalizedString(@"语音介绍")]) {
  56. // if (curUser.audio_file.length) {
  57. // self.audioBtn.hidden = NO;
  58. // [self.audioBtn setTitle:[NSString stringWithFormat:@" %@ ”",curUser.audio_time] forState:UIControlStateNormal];
  59. // }else{
  60. // self.audioBtn.hidden = YES;
  61. // }
  62. }
  63. }
  64. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  65. [super setSelected:selected animated:animated];
  66. // Configure the view for the selected state
  67. }
  68. @end