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.
85 lines
2.0 KiB
85 lines
2.0 KiB
// |
|
// MyTableViewCell.m |
|
// tongxin |
|
// |
|
// Created by ecell on 2023/6/21. |
|
// Copyright © 2023 xTT. All rights reserved. |
|
// |
|
|
|
#import "MyTableViewCell.h" |
|
|
|
@interface MyTableViewCell () |
|
|
|
@property (nonatomic ,weak) UIImageView *iconImg; |
|
|
|
|
|
@property (nonatomic ,weak) UILabel *titleLabel; |
|
|
|
@end |
|
|
|
@implementation MyTableViewCell |
|
|
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier |
|
{ |
|
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
|
if (self) |
|
{ |
|
self.selectionStyle = UITableViewCellSelectionStyleNone; |
|
self.backgroundColor = KKWhiteColorColor; |
|
[self subCellView]; |
|
} |
|
|
|
return self; |
|
} |
|
|
|
- (void)setImageName:(NSString *)imageName |
|
{ |
|
_imageName = imageName; |
|
self.iconImg.image = ImageName_(imageName); |
|
} |
|
|
|
- (void)setTitleName:(NSString *)titleName |
|
{ |
|
_titleName = titleName; |
|
self.titleLabel.text = titleName; |
|
} |
|
|
|
- (void)setMessageCount:(NSNumber *)messageCount |
|
{ |
|
_messageCount = messageCount; |
|
} |
|
|
|
- (void)subCellView |
|
{ |
|
UIImageView *iconImg = [UIImageView new]; |
|
self.iconImg = iconImg; |
|
[self.contentView addSubview:iconImg]; |
|
[iconImg mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.left.equalTo(self.contentView).offset(15); |
|
make.centerY.equalTo(self.contentView); |
|
make.size.mas_equalTo(CGSizeMake(22, 22)); |
|
}]; |
|
|
|
UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:Font_(16) textColor:KKTextColor text:@"" Radius:0]; |
|
self.titleLabel = titleLabel; |
|
[self.contentView addSubview:titleLabel]; |
|
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.left.equalTo(iconImg.mas_right).offset(10); |
|
make.centerY.equalTo(self.contentView); |
|
}]; |
|
|
|
} |
|
|
|
|
|
- (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 |
|
} |
|
|
|
@end
|
|
|