YHL_RedPacketTableViewCell.m 1.77 KB
//
//  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