0
它看起来很简单,但我不知道为什么我无法更改我工作的自定义标签的背景颜色。请检查我的代码下面的自定义单元格。更改自定义单元格的背景颜色
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
self.textLabel.backgroundColor = [UIColor clearColor];
self.textLabel.textColor = [UIColor orangeColor];
self.textLabel.text = @"lklklk";
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
self.contentView.backgroundColor = [UIColor blackColor];
self.accessoryView.backgroundColor = [UIColor blackColor];
}
return self;
}
该电池只能用白色化背景显示上面的文字
在此先感谢
谢谢雅各的回复,但它没有设置完整的单元格的背景颜色。配件箭头仍然有白色背景,这看起来不太好,我需要完整的黑色背景 – pankaj 2010-10-17 07:44:52
@ pankaj,现在就试试。 – 2010-10-17 07:47:23
试过,但仍然没有成功 – pankaj 2010-10-17 07:51:50