我正在使用iOS 7 beta检查我的应用程序。我已将UITableView
的背景颜色设置为透明色,但仍然显示白色背景。
是否有其他方法使它透明?
我正在使用iOS 7 beta检查我的应用程序。我已将UITableView
的背景颜色设置为透明色,但仍然显示白色背景。
是否有其他方法使它透明?
我无法让它工作,但是以下内容完美地工作:
-(void)tableView:(UITableView *)tableView
willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
[cell setBackgroundColor:[UIColor clearColor]];
}
clearColor
设置之前和之后使用 getRed:green:blue:alpha
得到的结果是相同的,但是上述代码确实具有将单元格背景从白色转换为透明的预期效果。 - Hot LickscellForRow
中将背景颜色设置为透明来解决这个问题。 - 0xWoodawakeFromNib
中设置backgroundColor
属性就足够了,但是对于iPad,我不仅需要在awakeFromNib
中设置backgroundColor
,还要在setSelected:animated:
中设置contentView的背景颜色。希望这能帮助到某些人。(请注意,此功能现已非测试版!) - livingtechcellForRowAtIndexPath
中,将导致 iOS 7 采用 XIB 指定的颜色:cell.backgroundColor = cell.backgroundColor;