2010-08-16 182 views
1
我現在遇到了個問題,如何使uitableview cell 的背景色填滿整個cell ,以下是我的代碼。但它不能正常工作、、、 

圖爲:的TableView單元格顏色

http://www.flickr.com/photos/53054715@N05/4898445104/

我如何代碼設置的顏色填充在細胞看法?

我的代碼在下面,但它不能正常工作。

cell.contentView.backgroundColor =[UIColor groupTableViewBackgroundColor]; 
cell.backgroundColor=[UIColor groupTableViewBackgroundColor]; 
cell.backgroundView.backgroundColor =[UIColor groupTableViewBackgroundColor]; 
cell.textLabel.backgroundColor = [UIColor groupTableViewBackgroundColor]; 
cell.detailTextLabel.backgroundColor = [UIColor groupTableViewBackgroundColor]; 
+0

可能的重複[如何獲得UITableViewCell中的透明配件視圖? (截圖)](http://stackoverflow.com/questions/1503664/how-to-get-transparent-accessory-view-in-uitableviewcell-w-screenshot) – jtbandes 2010-08-16 17:13:49

+0

謝謝你,我找到答案 – 2010-08-16 23:19:26

回答

0

它的工作原理!

  • (NSInteger的)numberOfSectionsInTableView:(UITableView的*)的tableView { [的tableView setBackgroundColor:的UIColor groupTableViewBackgroundColor]]; return 1; }