YH_ChannelCell.m 1.05 KB
//
//  YH_ChannelCell.m
//  YohoLive
//
//  Created by 盖剑秋 on 16/6/7.
//  Copyright © 2016年 YOHO!. All rights reserved.
//

#import "YH_ChannelCell.h"

@implementation YH_ChannelCell
{
    UILabel *titleLabel;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 300, 40)];
        titleLabel.font = [UIFont systemFontOfSize:16];
        [self.contentView addSubview:titleLabel];
    }
    return self;
}

- (void)bindChannelTitle:(NSString *)channelTitle selected:(BOOL)selected {
    titleLabel.text = channelTitle;
    if (selected) {
        self.contentView.backgroundColor = [UIColor blackColor];
        titleLabel.textColor = [UIColor whiteColor];
    } else {
        self.contentView.backgroundColor = [UIColor whiteColor];
        titleLabel.textColor = [UIColor blackColor];
    }
}


@end