2012-09-18 25 views
0

我有一個具有clearColor背景的自定義UITableView。我將單元格的backgroundView設置爲透明UIImageView,並將背景圖像視圖的backgroundColor設置爲[UIColor clearColor]。我還將單元格的backgroundColor設置爲[UIColor clearColor]如何在選擇時使單元格透明

我想在選擇時使cell.backgroundview爲透明。怎麼做?

回答

1

您可以明確地設置有半透明或透明的內容(的UIImageView)的細胞的selectedBackgroundView屬性,使我不會選擇成爲不透明

+0

Thanks..its working using cell.selectedBackgroundView =(transparent imageview) – iKT

0

在你的手機創作:

cell.selectedBackgroundView =[[UIImageView alloc] init]; 
((UIImageView *)cell.selectedBackgroundView).image = [UIImage imageNamed:@"your transparent UIImage"]; 

或:

UIView *v = [[UIView alloc] init]; 
v.backgroundColor = [UIColor clearColor]; 
cell.selectedBackgroundView = v; 
相關問題