2011-07-16 27 views

回答

2

您可以設置表視圖中使用相同的技術爲分組表視圖(類似self.tableView.backgroundView = anImageView;)的背景下,但是你的細胞背景是不透明的,因此會隱藏它。

然後你必須在tableView:cellForRowAtIndexPath中設置:單元格的背景顏色爲clearColor [UIColor clearColor],它的backgroundView爲nil。

現在運行應用程序,並且可能仍然存在問題:單元格標籤的背景可能也不透明(我之所以說可能是因爲單元格可能已經拾取單元格背景顏色並更改了其子視圖的背景顏色因此)。 如果是這種情況,請再次在tableView:cellForRowAtIndexPath:中設置子視圖的背景顏色爲clearColor。

+0

謝謝,那會做:) –

0

您也可以嘗試用自己的圖像設置圖像視圖backgroundView

UIImage *yourImage = ... 
UIImageView *imageView = [[UIImageView alloc] initWithImage:yourImage]; 
self.tableView.backgroundView = imageView; 
[imageView release];