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.
78 lines
2.4 KiB
78 lines
2.4 KiB
// |
|
// TFAboutTableViewCell.m |
|
// WXReader |
|
// |
|
// Created by 谢腾飞 on 2020/12/3. |
|
// Copyright © 2020 xtfei_2011@126.com. All rights reserved. |
|
// |
|
|
|
#import "TFAboutTableViewCell.h" |
|
|
|
@interface TFAboutTableViewCell () |
|
{ |
|
UILabel *titleLabel; |
|
UILabel *detailTitleLabel; |
|
UIImageView *connerImage; |
|
} |
|
@end |
|
|
|
@implementation TFAboutTableViewCell |
|
|
|
- (void)createSubviews |
|
{ |
|
[super createSubviews]; |
|
|
|
titleLabel = [[UILabel alloc] init]; |
|
titleLabel.textAlignment = NSTextAlignmentLeft; |
|
titleLabel.textColor = kBlackColor; |
|
titleLabel.font = kMainFont; |
|
[self.contentView addSubview:titleLabel]; |
|
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.left.mas_equalTo(kMargin); |
|
make.centerY.mas_equalTo(self.contentView.mas_centerY); |
|
make.width.mas_equalTo(120); |
|
make.height.mas_equalTo(kLabelHeight); |
|
}]; |
|
|
|
connerImage = [[UIImageView alloc] init]; |
|
connerImage.image = [UIImage imageNamed:@"public_more"]; |
|
connerImage.hidden = NO; |
|
[self.contentView addSubview:connerImage]; |
|
[connerImage mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kMargin); |
|
make.centerY.mas_equalTo(self.contentView.mas_centerY); |
|
make.width.height.mas_equalTo(10); |
|
}]; |
|
|
|
detailTitleLabel = [[UILabel alloc] init]; |
|
detailTitleLabel.textAlignment = NSTextAlignmentRight; |
|
detailTitleLabel.textColor = kGrayTextColor; |
|
detailTitleLabel.font = kFont12; |
|
[self.contentView addSubview:detailTitleLabel]; |
|
[detailTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.right.equalTo(connerImage); |
|
make.centerY.mas_equalTo(self.contentView.mas_centerY); |
|
make.left.equalTo(titleLabel.mas_right).offset(kHalfMargin); |
|
make.height.mas_equalTo(kLabelHeight); |
|
}]; |
|
} |
|
|
|
- (void)setContactInfoModel:(WXYZ_ContactInfoModel *)contactInfoModel |
|
{ |
|
_contactInfoModel = contactInfoModel; |
|
|
|
titleLabel.text = contactInfoModel.title?:@""; |
|
[titleLabel mas_updateConstraints:^(MASConstraintMaker *make) { |
|
make.width.mas_equalTo([TFViewHelper getDynamicWidthWithLabel:titleLabel]); |
|
}]; |
|
|
|
if (![contactInfoModel.action isEqualToString:@"url"]) { |
|
detailTitleLabel.text = contactInfoModel.content?:@""; |
|
connerImage.hidden = YES; |
|
} else { |
|
detailTitleLabel.text = @""; |
|
connerImage.hidden = NO; |
|
} |
|
} |
|
|
|
@end
|
|
|