You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.9 KiB

//
// NewWSettingTableViewCell.m
// tongxin
//
// Created by Apple on 2019/10/17.
// Copyright © 2019xTT. All rights reserved.
//
#import "NewWSettingTableViewCell.h"
@implementation NewWSettingTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = [UIColor clearColor];
self.contentView.backgroundColor = [UIColor clearColor];
//默认隐藏
self.switchBtn.hidden = YES;
self.switchBtn.onTintColor = mainColor;
[self.switchBtn addTarget:self action:@selector(switchBtnClick:) forControlEvents:UIControlEventTouchUpInside];
}
///设置圆角 (0:, 1:2,2:2)
- (void)setBackViewCornerWithType:(int)type{
CGFloat cornerRadius = 5;
UIRectCorner corners = UIRectCornerAllCorners;
if (type == 0){
cornerRadius = 0;
}else if (type == 1){
corners = UIRectCornerTopRight | UIRectCornerTopLeft;
}else if (type == 2){
corners = UIRectCornerBottomRight | UIRectCornerBottomLeft;
}
[self.backView setBorderWithCornerRadius:cornerRadius borderWidth:0 borderColor:[UIColor clearColor] type:corners];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
-(void)setTitle:(NSString *)title AndDetail:(NSString *)detail RoShowSwitch:(BOOL)isShow{
if (isShow) {
self.switchBtn.hidden = NO;
self.aDetailLabel.hidden = YES;
self.enterInfoIconView.hidden = YES;
}else{
self.switchBtn.hidden = YES;
self.aDetailLabel.hidden = NO;
self.enterInfoIconView.hidden = NO;
}
self.aTitleLabel.text = title;
self.aDetailLabel.textColor =mainColor;
self.aDetailLabel.text = detail;
}
-(void)switchBtnClick:(id)sender{
if(self.cellBack){
self.cellBack(sender,self);
}
}
@end