YHL_RedPacketTableViewCell.m
1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// YHL_RedPacketTableViewCell.m
// YohoLive
//
// Created by 盖剑秋 on 2016/11/14.
// Copyright © 2016年 YOHO!. All rights reserved.
//
#import "YHL_RedPacketTableViewCell.h"
#import "masonry.h"
@implementation YHL_RedPacketTableViewCell
{
UILabel *nameLabel;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
UIImageView *imgV = [UIImageView new];
imgV.image = [UIImage imageNamed:@"l_size_red"];
[self.contentView addSubview:imgV];
[imgV mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(76, 102));
make.top.mas_equalTo(10);
make.left.mas_equalTo(15);
}];
nameLabel = [UILabel new];
nameLabel.font = [UIFont boldSystemFontOfSize:17];
[self.contentView addSubview:nameLabel];
[nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(imgV.centerY);
make.left.mas_equalTo(106);
}];
UIView *line = [UIView new];
line.backgroundColor = [UIColor lightGrayColor];
[self.contentView addSubview:line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.and.bottom.and.right.mas_equalTo(0);
make.height.mas_equalTo(0.5);
}];
}
return self;
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)bindRedPacketName:(NSString *)nameStr {
nameLabel.text = nameStr;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end