YOUPAIZYSettingCell.m 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. //
  2. // YOUPAIZYSettingCell.m
  3. // VQU
  4. //
  5. // Created by Elaine on 2020/12/9.
  6. // Copyright © 2020 leo. All rights reserved.
  7. //
  8. #import "YOUPAIZYSettingCell.h"
  9. @implementation YOUPAIZYSettingCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  12. self.selectionStyle = UITableViewCellSelectionStyleNone;
  13. //v1.5.6 适配暗黑模式
  14. [self.contentView setBackgroundColor:[UIColor whiteColor]];
  15. [self youpaifinitUI];
  16. }
  17. return self;
  18. }
  19. - (void)youpaifinitUI{
  20. self.youpaipbaseView = [[UIView alloc]initWithFrame:CGRectMake(0.0f,0,KScreenWidth,54)];
  21. // self.baseView.backgroundColor = [UIColor whiteColor];
  22. [self.contentView addSubview:self.youpaipbaseView];
  23. [self.youpaipbaseView addLineWithColor:LZF5F4F7Color lineRect:CGRectMake(12.0f, 53.5f, KScreenWidth - 24.0f, 0.5f)];
  24. // self.line = [[UIView alloc]initWithFrame:CGRectMake(18,44.5,KScreenWidth-32-36,0.5)];
  25. // self.line.backgroundColor = HexColorFromRGB(0xEEEEEE);
  26. // [self.baseView addSubview:self.line];
  27. self.youpaiparrowImgView = [[UIImageView alloc]init];
  28. self.youpaiparrowImgView.contentMode = UIViewContentModeScaleAspectFill;
  29. self.youpaiparrowImgView.image = [UIImage imageNamed:@"vqu_images_H_cell_arrow_gray"];
  30. [self.youpaipbaseView addSubview:self.youpaiparrowImgView];
  31. [self.youpaiparrowImgView makeConstraints:^(MASConstraintMaker *make) {
  32. make.right.equalTo(-12.0f);
  33. make.centerY.equalTo(self.youpaipbaseView);
  34. // make.top.equalTo((self.frame.size.height-14)/2);
  35. make.size.mas_equalTo(CGSizeMake(10, 10));
  36. }];
  37. self.youpaiparrowLabel = [[UILabel alloc]init];
  38. self.youpaiparrowLabel.font = [UIFont systemFontOfSize:14];
  39. self.youpaiparrowLabel.textColor = LZA3AABEColor;
  40. self.youpaiparrowLabel.textAlignment = NSTextAlignmentRight;
  41. [self.youpaipbaseView addSubview:self.youpaiparrowLabel];
  42. [self.youpaiparrowLabel makeConstraints:^(MASConstraintMaker *make) {
  43. make.right.equalTo(self.youpaiparrowImgView.mas_left).offset(-5);
  44. make.centerY.equalTo(self.youpaipbaseView);
  45. make.height.equalTo(15);
  46. make.width.lessThanOrEqualTo(KScreenWidth / 2);
  47. }];
  48. self.youpaiprightSwitch = [UIButton buttonWithType:UIButtonTypeCustom];
  49. [self.youpaiprightSwitch setImage:[UIImage imageNamed:@"vqu_images_ic_profile_siwch_on"] forState:UIControlStateSelected];
  50. [self.youpaiprightSwitch setImage:[UIImage imageNamed:@"vqu_images_ic_profile_siwch_off"] forState:UIControlStateNormal];
  51. self.youpaiprightSwitch.hidden = YES;
  52. [self.youpaipbaseView addSubview:self.youpaiprightSwitch];
  53. [self.youpaiprightSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
  54. make.right.offset(-12.0f);
  55. make.centerY.mas_equalTo(0);
  56. make.size.mas_offset(CGSizeMake(40.0f, 22.0f));
  57. }];
  58. self.youpaipheadLabel = [[UILabel alloc]init];
  59. self.youpaipheadLabel.font = LCBoldFont(14.0f);
  60. self.youpaipheadLabel.textColor = LZ273145Color;
  61. self.youpaipheadLabel.textAlignment = NSTextAlignmentLeft;
  62. [self.youpaipbaseView addSubview:self.youpaipheadLabel];
  63. [self.youpaipheadLabel makeConstraints:^(MASConstraintMaker *make) {
  64. make.left.equalTo(self.youpaipbaseView.mas_left).offset(12.0f);
  65. make.centerY.equalTo(self.youpaipbaseView);
  66. make.height.equalTo(@15);
  67. }];
  68. // hintLabel
  69. self.youpaiphintLabel = [[UILabel alloc]init];
  70. self.youpaiphintLabel.font = LCFont(14);
  71. self.youpaiphintLabel.textColor = LZA3AABEColor;
  72. self.youpaiphintLabel.textAlignment = NSTextAlignmentLeft;
  73. [self.youpaipbaseView addSubview:self.youpaiphintLabel];
  74. [self.youpaiphintLabel makeConstraints:^(MASConstraintMaker *make) {
  75. make.left.equalTo(self.youpaipheadLabel.mas_right).offset(3.0f);
  76. make.centerY.equalTo(self.youpaipbaseView);
  77. make.height.equalTo(@15);
  78. }];
  79. self.youpaiphintLabel.text = [LCSaveModel getUserModel].youpaipuserinfo.youpaipis_anchor == 1 ? @"(开启后男用户将无法给你拨打视频)" : @"(开启后女神不可群发打招呼给你)";
  80. self.youpaiphintLabel.textColor = LZA3AABEColor;
  81. self.youpaiphintLabel.font = [UIFont systemFontOfSize:12];
  82. self.youpaiphintLabel.hidden = YES;
  83. // self.dataLabel = [[UILabel alloc]init];
  84. // self.dataLabel.font = [UIFont systemFontOfSize:14];
  85. // self.dataLabel.textColor = LCTextBlack;
  86. // self.dataLabel.textAlignment = NSTextAlignmentRight;
  87. // [self.contentView addSubview:self.dataLabel];
  88. // [self.dataLabel makeConstraints:^(MASConstraintMaker *make) {
  89. // make.left.equalTo(self.headLabel.right).offset(20);
  90. // make.top.equalTo((self.frame.size.height-20)/2);
  91. // make.height.equalTo(@20);
  92. // make.right.equalTo(self.arrowImgView.left).offset(-11);
  93. //
  94. // }];
  95. }
  96. - (void)layoutSubviews{
  97. // [self.arrowImgView updateConstraints:^(MASConstraintMaker *make) {
  98. // make.right.equalTo(@-15);
  99. // make.top.equalTo((self.frame.size.height-13)/2);
  100. // make.size.mas_equalTo(CGSizeMake(7, 13));
  101. // }];
  102. // [self.arrowLabel updateConstraints:^(MASConstraintMaker *make) {
  103. // make.right.equalTo(self.left).offset(-15);
  104. // make.top.equalTo((self.frame.size.height-20)/2);
  105. // make.height.equalTo(@20);
  106. // }];
  107. // [self.headLabel updateConstraints:^(MASConstraintMaker *make) {
  108. // make.left.equalTo(self.contentView.left).offset(15);
  109. // make.top.equalTo((self.frame.size.height-20)/2);
  110. // make.height.equalTo(@20);
  111. // }];
  112. // [self.dataLabel updateConstraints:^(MASConstraintMaker *make) {
  113. // make.left.equalTo(self.headLabel.right).offset(20);
  114. // make.top.equalTo((self.frame.size.height-20)/2);
  115. // make.height.equalTo(@20);
  116. // }];
  117. }
  118. @end