JXVipDetailBottomView.m 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // JXVipDetailBottomView.m
  3. // shiku_im
  4. //
  5. // Created by cindy on 2020/6/3.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXVipDetailBottomView.h"
  9. #import "Common.h"
  10. @implementation JXVipDetailBottomView
  11. -(instancetype)initWithFrame:(CGRect)frame {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. self.userInteractionEnabled=YES;
  15. [self _addSubViews];
  16. }
  17. return self;
  18. }
  19. - (void)_addSubViews {
  20. self.lineView = [[UIView alloc] initWithFrame:CGRectMake(0,0, kScreenWidth, 10)];
  21. self.lineView.layer.shadowColor = kRGBColor(232, 232, 232).CGColor;//阴影颜色
  22. self.lineView.layer.shadowOffset = CGSizeMake(0, 0);//偏移距离
  23. self.lineView.layer.shadowOpacity = 0.5;//不透明度
  24. self.lineView.layer.shadowRadius = 10.0;//半径
  25. self.lineView.backgroundColor = kRGBColor(246, 246, 246);
  26. [self addSubview:self.lineView];
  27. self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(15, self.lineView.bottom+15, 2, 20)];
  28. self.imgView.backgroundColor= [UIColor redColor];
  29. [self addSubview:self.imgView];
  30. self.zunxiangLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.imgView.right+5, 20, 130, 30)];
  31. self.zunxiangLabel.text = @"VIP1尊享";
  32. self.zunxiangLabel.textColor = [UIColor blackColor];
  33. self.zunxiangLabel.textAlignment = NSTextAlignmentLeft;
  34. self.zunxiangLabel.font = [UIFont boldSystemFontOfSize:22];
  35. [self addSubview:self.zunxiangLabel];
  36. NSArray *imageArray = @[@"sjlj",@"群聊等级VIp标识",@"meirhb",@"bqb",@"bqb"];
  37. NSArray *titleArray = @[@"500",@"帝王",@"1",@"表情包",@"1",@"2"];
  38. NSArray *detailArray = @[
  39. @"晋升礼金(活动中心发放)",@"荣誉称号",@"准点红包(群聊专属)",@"(特需发言 紫色)" ,@"美女客服1V1",];
  40. // NSArray *detailArray = @[ @"晋升礼金(活动中心发放)",@"1(荣耀称号帝王)",@"准点红包(群聊)",@"1(特需发言 紫色)",];
  41. int xLeft = 0;
  42. int yleft = self.imgView.bottom;
  43. CGFloat buttonWidth = (kScreenWidth-30)/2;
  44. for (int i=0; i<imageArray.count; i++) {
  45. NSString *title = titleArray[i];
  46. NSString *detai = detailArray[i];
  47. _button = [UIButton buttonWithType:UIButtonTypeCustom];
  48. if (xLeft +buttonWidth > kScreenWidth){
  49. xLeft = 0;
  50. yleft = yleft+10+50;
  51. }
  52. _button.frame = CGRectMake(xLeft + 10, yleft + 10, buttonWidth, 50);
  53. _button.tag = 10+i;
  54. [self addSubview:_button];
  55. self.buttonIconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 0, 25, 40)];
  56. self.buttonIconImageView.image = [UIImage imageNamed:imageArray[i]];
  57. self.buttonIconImageView.contentMode=UIViewContentModeScaleAspectFit;
  58. self.buttonIconImageView.tag = 100+i;
  59. [_button addSubview:self.buttonIconImageView];
  60. self.buttonTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.buttonIconImageView.right+10, 0, _button.width-(self.buttonIconImageView.right+10), 20)];
  61. self.buttonTitleLabel.text = title;
  62. self.buttonTitleLabel.tag = 200+i;
  63. self.buttonTitleLabel.textColor = [UIColor blackColor];
  64. self.buttonTitleLabel.font = [UIFont boldSystemFontOfSize:15];
  65. self.buttonTitleLabel.textAlignment = NSTextAlignmentLeft;
  66. [_button addSubview:self.buttonTitleLabel];
  67. self.buttonDetailLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.buttonIconImageView.right+10, self.buttonTitleLabel.bottom, _button.width-(self.buttonIconImageView.right+10), 30)];
  68. self.buttonDetailLabel.text = detai;
  69. self.buttonDetailLabel.tag = 300+i;
  70. self.buttonDetailLabel.textColor = [UIColor lightGrayColor];
  71. self.buttonDetailLabel.font = [UIFont systemFontOfSize:12];
  72. self.buttonDetailLabel.textAlignment = NSTextAlignmentLeft;
  73. self.buttonDetailLabel.numberOfLines = 0;
  74. [_button addSubview:self.buttonDetailLabel];
  75. CGFloat oranginX = CGRectGetMaxX(_button.frame);
  76. xLeft = oranginX;
  77. }
  78. }
  79. @end