2011-05-31 74 views

回答

9

添加一個UIImageView到視圖,ontop那個地方的UITableView並設置背景顏色爲clearcolor。

+0

+1:好和快速的方法。 – Jhaliya 2011-05-31 13:07:28

+1

你也可以使用' - [UIColor colorWithPatternImage:UIImage];' – 2011-05-31 13:08:34

+0

爲單個單元格的背景分配圖像Pallavi的其他答案是正確的。 – TheBlack 2011-05-31 13:16:41

14

使用此

UIImageView *imageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cloud.png"] ]; 
self.tableView.backgroundView = imageView; 

[imageView release]; 

self.tableView.backgroundColor = [UIColor clearColor]; 
2

您也可以繼續直接設置背景色:

self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.jpg"]];