12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- //
- // JXVipDetailBottomView.m
- // shiku_im
- //
- // Created by cindy on 2020/6/3.
- // Copyright © 2020 Reese. All rights reserved.
- //
- #import "JXVipDetailBottomView.h"
- #import "Common.h"
- @implementation JXVipDetailBottomView
- -(instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- self.userInteractionEnabled=YES;
- [self _addSubViews];
- }
- return self;
- }
- - (void)_addSubViews {
- self.lineView = [[UIView alloc] initWithFrame:CGRectMake(0,0, kScreenWidth, 10)];
- self.lineView.layer.shadowColor = kRGBColor(232, 232, 232).CGColor;//阴影颜色
- self.lineView.layer.shadowOffset = CGSizeMake(0, 0);//偏移距离
- self.lineView.layer.shadowOpacity = 0.5;//不透明度
- self.lineView.layer.shadowRadius = 10.0;//半径
- self.lineView.backgroundColor = kRGBColor(246, 246, 246);
- [self addSubview:self.lineView];
-
-
- self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(15, self.lineView.bottom+15, 2, 20)];
- self.imgView.backgroundColor= [UIColor redColor];
- [self addSubview:self.imgView];
-
- self.zunxiangLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.imgView.right+5, 20, 130, 30)];
- self.zunxiangLabel.text = @"VIP1尊享";
- self.zunxiangLabel.textColor = [UIColor blackColor];
- self.zunxiangLabel.textAlignment = NSTextAlignmentLeft;
- self.zunxiangLabel.font = [UIFont boldSystemFontOfSize:22];
- [self addSubview:self.zunxiangLabel];
-
- NSArray *imageArray = @[@"sjlj",@"群聊等级VIp标识",@"meirhb",@"bqb",@"bqb"];
- NSArray *titleArray = @[@"500",@"帝王",@"1",@"表情包",@"1",@"2"];
- NSArray *detailArray = @[
- @"晋升礼金(活动中心发放)",@"荣誉称号",@"准点红包(群聊专属)",@"(特需发言 紫色)" ,@"美女客服1V1",];
- // NSArray *detailArray = @[ @"晋升礼金(活动中心发放)",@"1(荣耀称号帝王)",@"准点红包(群聊)",@"1(特需发言 紫色)",];
-
- int xLeft = 0;
- int yleft = self.imgView.bottom;
- CGFloat buttonWidth = (kScreenWidth-30)/2;
- for (int i=0; i<imageArray.count; i++) {
- NSString *title = titleArray[i];
- NSString *detai = detailArray[i];
-
- _button = [UIButton buttonWithType:UIButtonTypeCustom];
- if (xLeft +buttonWidth > kScreenWidth){
- xLeft = 0;
- yleft = yleft+10+50;
- }
- _button.frame = CGRectMake(xLeft + 10, yleft + 10, buttonWidth, 50);
- _button.tag = 10+i;
- [self addSubview:_button];
-
- self.buttonIconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 0, 25, 40)];
- self.buttonIconImageView.image = [UIImage imageNamed:imageArray[i]];
- self.buttonIconImageView.contentMode=UIViewContentModeScaleAspectFit;
- self.buttonIconImageView.tag = 100+i;
- [_button addSubview:self.buttonIconImageView];
-
- self.buttonTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.buttonIconImageView.right+10, 0, _button.width-(self.buttonIconImageView.right+10), 20)];
- self.buttonTitleLabel.text = title;
- self.buttonTitleLabel.tag = 200+i;
- self.buttonTitleLabel.textColor = [UIColor blackColor];
- self.buttonTitleLabel.font = [UIFont boldSystemFontOfSize:15];
- self.buttonTitleLabel.textAlignment = NSTextAlignmentLeft;
- [_button addSubview:self.buttonTitleLabel];
-
- self.buttonDetailLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.buttonIconImageView.right+10, self.buttonTitleLabel.bottom, _button.width-(self.buttonIconImageView.right+10), 30)];
- self.buttonDetailLabel.text = detai;
- self.buttonDetailLabel.tag = 300+i;
- self.buttonDetailLabel.textColor = [UIColor lightGrayColor];
- self.buttonDetailLabel.font = [UIFont systemFontOfSize:12];
- self.buttonDetailLabel.textAlignment = NSTextAlignmentLeft;
- self.buttonDetailLabel.numberOfLines = 0;
- [_button addSubview:self.buttonDetailLabel];
-
- CGFloat oranginX = CGRectGetMaxX(_button.frame);
- xLeft = oranginX;
- }
-
-
- }
- @end
|