我想將uiimageview和uilabel添加到選定的行中。 現在,當我在表中選擇該行,然後在didSelectRowAtIndexPath + uiTableview上添加uiimageview和uilabel
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Deselect cell
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
> tableView deselectRowAtIndexPath:indexPath animated:TRUE];
if (indexPath.row == 0) {
imageView1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"AboutImage.png"]];
imageView1.center = CGPointMake(310, 48);
[cell.contentView addSubview:imageView1];
[imageView1 release];
imageView2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"AboutImage.png"]];
imageView2.center = CGPointMake(310, 48);
[cell.contentView addSubview:imageView2];
[imageView2 release];
但後來也這樣做了ImageView的是沒有出現以後。 請誰能幫助me..How添加的UIImageView和標籤進入細胞。
在此先感謝