YH_ChannelCell.m
1.05 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
//
// 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