2012-07-25 46 views
0

我有一個GridViewCell和它的背景我設置爲clearColor像這樣:持久白色背景雖然我已經將它設置爲清除

UIView* mainView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 160, 123)]; 
[mainView setBackgroundColor:[UIColor clearColor]]; 

雖然由於某些原因,背景仍然是白色的。

這是我所看到的:

enter image description here

如果它的任何幫助,我在下面this tutorial

回答

0

大量的試驗和錯誤之後,我想通了,我cellForItemAtIndex方法,我需要設置細胞的backgkround顏色以清除像這樣:

[cell setBackgroundColor:[UIColor clearColor]]; 
0

我很確定你看到的是window

在應用程序委託:

[self.window setBackgroundColor:[UIColor redColor]];

,你應該看到所有紅色。

+0

如果你使用IB,你也可以在那裏改變'window'的'backgroundColor'。 – runmad 2012-07-25 14:58:49

+0

嗯,它沒有效果。我已經放置了一張圖片供你看。 – 2012-07-25 15:04:15

相關問題