2010-10-29 150 views

回答

0

selectedBackgroundViewUITableViewCell設置爲您的自定義視圖。

+0

PhraseSelectedCellViewController * phrView = [[PhraseSelectedCellViewController alloc] initWithFrame:CGRectMake(0,0,320,60)]; [cell.contentView addSubview:phrView]; cell.selectedBackgroundView = phrView; \t [phrView release];好嗎? – raien 2010-10-29 02:06:38

+0

我做到了。謝謝 – raien 2010-10-29 02:34:23

2
 #define kCellHeight 50 //Replace '50' with Height of your UITableViewCell 
     #define kSelectedCellBackgroundImage @"nameOfYourImage" //replace value inside "" with name of your image 

     UIImageView *selectedBackgroundView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, kCellHeight)]; 
     [selectedBackgroundView setImage:[UIImage imageNamed:kSelectedCellBackgroundImage]]; 
     [cell setSelectedBackgroundView:selectedBackgroundView]; 
     [selectedBackgroundView release]; 
相關問題