我试图得到了每一个细胞自身的背景,但它看起来像:单元格背景
这里是我与
cell.team1Label.backgroundColor = [UIColor clearColor];
cell.team2Label.backgroundColor = [UIColor clearColor];
cell.dateLabel.backgroundColor = [UIColor clearColor];
cell.timeLabel.backgroundColor = [UIColor clearColor];
cell.stadiumLabel.backgroundColor = [UIColor clearColor];
cell.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"cell.png"]];
感谢
“任何其他视图”我的意思是容器视图,其中包含所有标签或类似的东西。如果有任何这些,你应该将他们的backgroundColor设置为[UIColor clearColor] – 2011-04-15 20:33:05
有一点需要注意的是与tableview单元格中使用的透明视图相关的潜在性能损失。文档引述如下:“如果你确实采用这种方法,尽可能避免使视图透明。透明子视图会因合成成本增加而影响滚动性能”http://developer.apple.com/library/ios/文档/ UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#// apple_ref/doc/uid/TP40007451-CH7-SW15 – 2011-04-16 06:48:29
实际情况并不差,但是,使用不透明图像会是一个更好的性能决定。 – 2012-04-29 15:24:54