| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- //
- // MOGuildSureCell.m
- // MiMoLive
- //
- // Created by SuperC on 2025/10/16.
- //
- #import "MOGuildSureCell.h"
- @implementation MOGuildSureCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
- {
- //Cell 去除选中效果
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- self.backgroundColor = [UIColor clearColor];
-
- [self.contentView addSubview:self.applyBtn];
- [self.applyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.leading.mas_equalTo(@32.0);
- make.trailing.mas_equalTo(@-32.0);
- make.height.mas_equalTo(@48.0);
- make.centerY.equalTo(self.contentView);
- }];
- }
- return self;
- }
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- - (void)setIsApply:(BOOL)isApply{
- _isApply = isApply;
-
- if(isApply){
- [self.applyBtn setTitle:NSLocalString(@"mimo_guild_applying") forState:UIControlStateNormal];
- self.applyBtn.alpha = 0.4;
- }
- }
- - (void)setCanClick:(BOOL)canClick{
-
- if(self.isApply){
- canClick = NO;
- }
-
- _canClick = canClick;
-
- if(self.isApply){
-
- }
- else{
- if(canClick){
- self.applyBtn.alpha = 1.0;
- }
- else{
- self.applyBtn.alpha = 0.4;
- }
- }
- }
- - (UIButton *)applyBtn{
- if(!_applyBtn){
- _applyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- [_applyBtn addTarget:self action:@selector(applyBtnClick) forControlEvents:UIControlEventTouchUpInside];
-
- [_applyBtn setTitle:NSLocalString(@"mimo_fans_fans_club_create_submit") forState:UIControlStateNormal];
-
- NSArray *applyColorArr = @[kBaseColorLeft,kBaseColorRight];
- UIImage *applyImage = [MOTools createGradientRectImageWithBounds:CGRectMake(0, 0, (SCREENWIDTH - 32.0 * 2.0), 48.0) Colors:applyColorArr GradientType:0];
- [_applyBtn setBackgroundImage:applyImage forState:UIControlStateNormal];
- _applyBtn.layer.cornerRadius = 16.0;
- _applyBtn.layer.masksToBounds = YES;
- [_applyBtn setFont:[MOTextTools poppinsMediumFont:16.0]];
- }
- return _applyBtn;
- }
- - (void)applyBtnClick{
- self.applyBtnClickBlcok ? self.applyBtnClickBlcok() : nil;
- }
- @end
|