小说绘上架版本
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// TFAboutTableViewCell.h
|
||||
// WXReader
|
||||
//
|
||||
// Created by 谢腾飞 on 2020/12/3.
|
||||
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "WXYZ_AboutModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TFAboutTableViewCell : TFBasicTableViewCell
|
||||
|
||||
@property (nonatomic, strong) WXYZ_ContactInfoModel *contactInfoModel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// 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
|
||||
Reference in New Issue
Block a user