CNHomeRightTableViewCell.m 1.63 KB
//
//  CNHomeRightTableViewCell.m
//  CNLiveScioLive
//
//  Created by Xiaowen Zhang on 2018/9/19.
//  Copyright © 2018年 CNLive. All rights reserved.
//

#import "CNHomeRightTableViewCell.h"
@interface CNHomeRightTableViewCell()
@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation CNHomeRightTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.numberOfLines = 1;
        _titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        _titleLabel.textColor = HEXCOLOR(0x333333);
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_titleLabel];

        
    }
    return self;
    
}
- (void)setTitle:(NSString *)title{
    _title = title;
    _titleLabel.text = title;
}
- (void)layoutSubviews{
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(0);
        make.right.equalTo(self.mas_right).with.offset(0);
        make.top.equalTo(self.mas_top).with.offset(0);
        make.bottom.equalTo(self.mas_bottom).with.offset(0);
    }];

}
- (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