|
|
// |
|
|
// ListTableViewCell.m |
|
|
// Lookfit |
|
|
// |
|
|
// Created by ecell on 2023/3/16. |
|
|
// Copyright © 2023 Sheldon. All rights reserved. |
|
|
// |
|
|
|
|
|
#import "ListTableViewCell.h" |
|
|
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width |
|
|
|
|
|
@interface ListTableViewCell () |
|
|
|
|
|
@property (nonatomic ,weak) UILabel *nameLabel; |
|
|
|
|
|
@property (nonatomic ,weak) UILabel *msgLabel; |
|
|
|
|
|
@end |
|
|
|
|
|
@implementation ListTableViewCell |
|
|
|
|
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier |
|
|
{ |
|
|
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
|
|
if (self) |
|
|
{ |
|
|
self.selectionStyle = UITableViewCellSelectionStyleNone; |
|
|
self.backgroundColor = UIColor.clearColor; |
|
|
[self subCellView]; |
|
|
} |
|
|
|
|
|
return self; |
|
|
} |
|
|
|
|
|
- (void)setMsgModel:(MusicModel *)msgModel |
|
|
{ |
|
|
_msgModel = msgModel; |
|
|
self.nameLabel.text = [NSString stringWithFormat:@"%@.MP3",msgModel.name]; |
|
|
self.msgLabel.text = [NSString stringWithFormat:@"%@ %@",msgModel.singer,msgModel.musicSize]; |
|
|
} |
|
|
|
|
|
- (void)subCellView |
|
|
{ |
|
|
UILabel *nameLabel = [UILabel new]; |
|
|
nameLabel.textColor = [UIColor colorWithRed:81.0/255.0 green:81.0/255.0 blue:81.0/255.0 alpha:1]; |
|
|
nameLabel.textAlignment = NSTextAlignmentLeft; |
|
|
nameLabel.frame = CGRectMake(15, 15, SCREEN_WIDTH-30, 20); |
|
|
nameLabel.font = [UIFont fontWithName:@"HelveticaNeue" size: 18]; |
|
|
self.nameLabel = nameLabel; |
|
|
[self.contentView addSubview:nameLabel]; |
|
|
|
|
|
UILabel *msgLabel = [UILabel new]; |
|
|
msgLabel.frame = CGRectMake(15, 40, SCREEN_WIDTH-30, 20); |
|
|
msgLabel.font = [UIFont fontWithName:@"HelveticaNeue" size: 16]; |
|
|
msgLabel.textColor = [UIColor colorWithRed:191.0/255.0 green:191.0/255.0 blue:191.0/255.0 alpha:1]; |
|
|
self.msgLabel = msgLabel; |
|
|
[self.contentView addSubview:msgLabel]; |
|
|
} |
|
|
|
|
|
- (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
|
|
|
|