YOUPAIZYUserZiLiaoGRXXContentCell.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // YOUPAIZYUserZiLiaoGRXXContentCell.m
  3. // MSYOUPAI
  4. //
  5. // Created by xiaohaoran on 2022/3/4.
  6. // Copyright © 2022 MS. All rights reserved.
  7. //
  8. #import "YOUPAIZYUserZiLiaoGRXXContentCell.h"
  9. @implementation YOUPAIZYUserZiLiaoGRXXContentCell
  10. -(instancetype)initWithFrame:(CGRect)frame{
  11. self = [super initWithFrame:frame];
  12. if (self) {
  13. [self youpaifsetSubView];
  14. }
  15. return self;
  16. }
  17. -(void)youpaifsetSubView{
  18. //bg
  19. UIView *bgView = [UIView new];
  20. [self.contentView addSubview:bgView];
  21. [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
  22. make.edges.mas_equalTo(0);
  23. }];
  24. bgView.backgroundColor = LZFAFAFCColor;
  25. bgView.layer.cornerRadius = 8;
  26. bgView.clipsToBounds = YES;
  27. //标题
  28. self.youpaiTitle = [UILabel new];
  29. [bgView addSubview:self.youpaiTitle];
  30. [self.youpaiTitle mas_makeConstraints:^(MASConstraintMaker *make) {
  31. make.left.mas_equalTo(8);
  32. make.top.mas_equalTo(8);
  33. make.height.mas_equalTo(12);
  34. }];
  35. self.youpaiTitle.textColor = LZA3AABEColor;
  36. self.youpaiTitle.font = [UIFont systemFontOfSize:10];
  37. self.youpaiTitle.text = @"性别";
  38. //内容
  39. self.youpaiContent = [UILabel new];
  40. [bgView addSubview:self.youpaiContent];
  41. [self.youpaiContent mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.left.mas_equalTo(8);
  43. make.top.mas_equalTo(self.youpaiTitle.mas_bottom).offset(6);
  44. }];
  45. self.youpaiContent.textColor = LZ273145Color;
  46. self.youpaiContent.font = [UIFont systemFontOfSize:12];
  47. self.youpaiContent.text = @"女";
  48. //拷贝按钮
  49. self.youpaicopyBtn = [UIButton new];
  50. [bgView addSubview:self.youpaicopyBtn];
  51. [self.youpaicopyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  52. make.left.mas_equalTo(self.youpaiContent.mas_right).offset(2);
  53. make.centerY.mas_equalTo(self.youpaiContent);
  54. make.size.mas_equalTo(CGSizeMake(12, 12));
  55. }];
  56. [self.youpaicopyBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_ZY_copy"] forState:UIControlStateNormal];
  57. }
  58. @end