// // YOUPAIZYSettingCell.m // VQU // // Created by Elaine on 2020/12/9. // Copyright © 2020 leo. All rights reserved. // #import "YOUPAIZYSettingCell.h" @implementation YOUPAIZYSettingCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { self.selectionStyle = UITableViewCellSelectionStyleNone; //v1.5.6 适配暗黑模式 [self.contentView setBackgroundColor:[UIColor whiteColor]]; [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ self.youpaipbaseView = [[UIView alloc]initWithFrame:CGRectMake(0.0f,0,KScreenWidth,54)]; // self.baseView.backgroundColor = [UIColor whiteColor]; [self.contentView addSubview:self.youpaipbaseView]; [self.youpaipbaseView addLineWithColor:LZF5F4F7Color lineRect:CGRectMake(12.0f, 53.5f, KScreenWidth - 24.0f, 0.5f)]; // self.line = [[UIView alloc]initWithFrame:CGRectMake(18,44.5,KScreenWidth-32-36,0.5)]; // self.line.backgroundColor = HexColorFromRGB(0xEEEEEE); // [self.baseView addSubview:self.line]; self.youpaiparrowImgView = [[UIImageView alloc]init]; self.youpaiparrowImgView.contentMode = UIViewContentModeScaleAspectFill; self.youpaiparrowImgView.image = [UIImage imageNamed:@"vqu_images_H_cell_arrow_gray"]; [self.youpaipbaseView addSubview:self.youpaiparrowImgView]; [self.youpaiparrowImgView makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(-12.0f); make.centerY.equalTo(self.youpaipbaseView); // make.top.equalTo((self.frame.size.height-14)/2); make.size.mas_equalTo(CGSizeMake(10, 10)); }]; self.youpaiparrowLabel = [[UILabel alloc]init]; self.youpaiparrowLabel.font = [UIFont systemFontOfSize:14]; self.youpaiparrowLabel.textColor = LZA3AABEColor; self.youpaiparrowLabel.textAlignment = NSTextAlignmentRight; [self.youpaipbaseView addSubview:self.youpaiparrowLabel]; [self.youpaiparrowLabel makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.youpaiparrowImgView.mas_left).offset(-5); make.centerY.equalTo(self.youpaipbaseView); make.height.equalTo(15); make.width.lessThanOrEqualTo(KScreenWidth / 2); }]; self.youpaiprightSwitch = [UIButton buttonWithType:UIButtonTypeCustom]; [self.youpaiprightSwitch setImage:[UIImage imageNamed:@"vqu_images_ic_profile_siwch_on"] forState:UIControlStateSelected]; [self.youpaiprightSwitch setImage:[UIImage imageNamed:@"vqu_images_ic_profile_siwch_off"] forState:UIControlStateNormal]; self.youpaiprightSwitch.hidden = YES; [self.youpaipbaseView addSubview:self.youpaiprightSwitch]; [self.youpaiprightSwitch mas_makeConstraints:^(MASConstraintMaker *make) { make.right.offset(-12.0f); make.centerY.mas_equalTo(0); make.size.mas_offset(CGSizeMake(40.0f, 22.0f)); }]; self.youpaipheadLabel = [[UILabel alloc]init]; self.youpaipheadLabel.font = LCBoldFont(14.0f); self.youpaipheadLabel.textColor = LZ273145Color; self.youpaipheadLabel.textAlignment = NSTextAlignmentLeft; [self.youpaipbaseView addSubview:self.youpaipheadLabel]; [self.youpaipheadLabel makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.youpaipbaseView.mas_left).offset(12.0f); make.centerY.equalTo(self.youpaipbaseView); make.height.equalTo(@15); }]; // hintLabel self.youpaiphintLabel = [[UILabel alloc]init]; self.youpaiphintLabel.font = LCFont(14); self.youpaiphintLabel.textColor = LZA3AABEColor; self.youpaiphintLabel.textAlignment = NSTextAlignmentLeft; [self.youpaipbaseView addSubview:self.youpaiphintLabel]; [self.youpaiphintLabel makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.youpaipheadLabel.mas_right).offset(3.0f); make.centerY.equalTo(self.youpaipbaseView); make.height.equalTo(@15); }]; self.youpaiphintLabel.text = [LCSaveModel getUserModel].youpaipuserinfo.youpaipis_anchor == 1 ? @"(开启后男用户将无法给你拨打视频)" : @"(开启后女神不可群发打招呼给你)"; self.youpaiphintLabel.textColor = LZA3AABEColor; self.youpaiphintLabel.font = [UIFont systemFontOfSize:12]; self.youpaiphintLabel.hidden = YES; // self.dataLabel = [[UILabel alloc]init]; // self.dataLabel.font = [UIFont systemFontOfSize:14]; // self.dataLabel.textColor = LCTextBlack; // self.dataLabel.textAlignment = NSTextAlignmentRight; // [self.contentView addSubview:self.dataLabel]; // [self.dataLabel makeConstraints:^(MASConstraintMaker *make) { // make.left.equalTo(self.headLabel.right).offset(20); // make.top.equalTo((self.frame.size.height-20)/2); // make.height.equalTo(@20); // make.right.equalTo(self.arrowImgView.left).offset(-11); // // }]; } - (void)layoutSubviews{ // [self.arrowImgView updateConstraints:^(MASConstraintMaker *make) { // make.right.equalTo(@-15); // make.top.equalTo((self.frame.size.height-13)/2); // make.size.mas_equalTo(CGSizeMake(7, 13)); // }]; // [self.arrowLabel updateConstraints:^(MASConstraintMaker *make) { // make.right.equalTo(self.left).offset(-15); // make.top.equalTo((self.frame.size.height-20)/2); // make.height.equalTo(@20); // }]; // [self.headLabel updateConstraints:^(MASConstraintMaker *make) { // make.left.equalTo(self.contentView.left).offset(15); // make.top.equalTo((self.frame.size.height-20)/2); // make.height.equalTo(@20); // }]; // [self.dataLabel updateConstraints:^(MASConstraintMaker *make) { // make.left.equalTo(self.headLabel.right).offset(20); // make.top.equalTo((self.frame.size.height-20)/2); // make.height.equalTo(@20); // }]; } @end