我有这张桌子:
如何摆脱文本背后的方框?
这是我目前的代码:
UIColor *CellColor = [UIColor colorWithWhite:0.7 alpha:0.2];
cell.backgroundColor = CellColor;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.font = [UIFont systemFontOfSize:16.0];
cell.textLabel.textAlignment = UITextAlignmentRight;
cell.textLabel.textColor = [UIColor whiteColor];
cell.detailTextLabel.font = [UIFont systemFontOfSize:10.0];
cell.detailTextLabel.textColor = [UIColor whiteColor];
cell.textLabel.text = @"Title text...";
cell.detailTextLabel.text = @"Subtitle text...";
答案 0 :(得分:3)
UILabel的默认背景颜色为白色。所以这很正常。
如果您想要透明背景,则需要使用:
cell.textLabel.backgroundColor = [ UIColor clearColor ];
同样适用于detailTextLabel