0
當我選擇行時,更改backgroundimages?如何更改tableviewcell的backgroundimage?
當我選擇行時,更改backgroundimages?如何更改tableviewcell的backgroundimage?
將selectedBackgroundView
的UITableViewCell
設置爲您的自定義視圖。
#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];
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
我做到了。謝謝 – raien 2010-10-29 02:34:23