2010-02-13 29 views
2

我是iphone開發新手。我已經在分組表格視圖中顯示了內容列表。如何設置表格背景透明,例如我應該看到灰色(默認顏色)背景上顯示的文字,而不是白色。請幫我。謝謝。如何在iPhone中設置表背景透明?

回答

9
cell.backgroundColor=[UIColor clearColor] 

這對我工作的罰款。

+0

即使將背景設置爲「清除顏色」,單元格在故事板中被標記爲不「不透明」。 (XCode 5) – Matt 2013-10-17 22:51:31

-2

的UITableView繼承UIView的一個 '阿爾法' 屬性,以便嘗試改變這種:)

+0

我正在使用分組表如何更改第一個表的Alpha值 – Warrior 2010-02-13 12:06:16

+0

因此,您希望一個表中的第一個組是透明的還是實際上有幾個表? – willcodejavaforfood 2010-02-13 12:43:01

+0

我想要一個表中的第一組透明 – Warrior 2010-02-13 12:44:52

3
table.backgroundColor = [UIColor clearColor] 

馬爾科

0

在iOS 6中,這似乎還不夠。我同時設置,

menuTable.backgroundColor = [UIColor clearColor]; 
if ([menuTable respondsToSelector:@selector(setBackgroundView:)]) { // only after 3.2 
    [menuTable setBackgroundView:nil]; 
} 
0
self.view.layer.backgroundColor = [UIColor clearColor].CGColor; 

適用於iOS 9

0
cell.backgroundColor = [UIColor clearColor]; 
cell.backgroundView = nil; 
table.backgroundView = nil; 

這對我的作品。