[英]Custom Cell - Change color of background and button in custom cell
I have a custom cell that I have made in the iterfacebuilder and connected to my .h file. 我在iterfacebuilder中创建了一个自定义单元,并连接到我的.h文件。
And then in my CustomCell.m file I have 然后在我的CustomCell.m文件中
@implementation TwoMealsTableViewCell
@synthesize dayLabel, firstMealBtn, secondMealBtn, indexPath;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
dayLabel.textColor = [UIColor orangeColor];
if (self) {
dayLabel.textColor = [UIColor orangeColor];
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
And I have the cell all set up in the tableview, and I see the buttons, and labels, but I don't see the color change? 我已经在表格视图中设置了所有单元格,并且看到了按钮和标签,但是没有看到颜色变化吗?
Why is this. 为什么是这样。
Thanks for the help in advance!!! 我在这里先向您的帮助表示感谢!!!
这将改变单元格的颜色
dayLabel.textColor = [UIColor orangeColor];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.