J'ai beaucoup ajouté à mon CustomCell, son fonctionnement est génial.Personnalisé UITableViewCell qui se développe au toucher et inclut uitextfield
Mon exigence est, pour un TableView groupé, En tapant sur un seul UITableViewCell, il faut développer ci-dessous, animer et étendre plus bas et afficher plus d'informations dans cette cellule.
En tapant sur une cellule déjà étendue, elle devrait revenir à un état de cellule "normal".
Toute direction je peux avoir ici serait génial ..
aussi, un coup d'oeil sur le code suivant, il y a des variables pour une cellule et j'ajouter une image à la cell.acccessoryVIew, cependant, il y a quelques exemples où ils écrivent le code d'ajouter une image au sein de if (cell == nil) {}.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *kCustomCellID = @"MyCellDetailSym";
CustomCell *cell = (CustomCell *)[self.tableView dequeueReusableCellWithIdentifier:kCustomCellID];
if (cell == nil)
{
cell = (CustomCell *)[[[CustomCell alloc] initWithFrame:CGRectZero reuseIdentifier:kCustomCellID] autorelease];
}
cell.checkNeeded = YES;
appdelegate *appDelegate = (appdelegate *)[[UIApplication sharedApplication] delegate];
customClass *nSym = (customClass *)[ArrayCache objectAtIndex:indexPath.row];
if([appDelegate.sMap containsObject:[NSString stringWithFormat:@"%d",[nSym pKey]]]) { cell.checked=YES; } else cell.checked = NO;
if([appDelegate.favoriteSymArray containsObject:[NSString stringWithFormat:@"%d",[nSym pKey]]]) { cell.starred=YES; } else cell.starred = NO;
cell.title = nSym.txtSym;
UIImage *starredImage = [UIImage imageNamed:@"Star_list_active.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
CGRect frame = CGRectMake(0.0, 0.0, starredImage.size.width + 5 , starredImage.size.height + 5);
button.frame = frame;
UIImage *image = (cell.starred) ? starredImage: [UIImage imageNamed:@"Star_list_inactive.png"];
//UIImage *newImage = [image stretchableImageWithLeftCapWidth:12.0 topCapHeight:0.0];
[button setEnabled:YES];
[button setBackgroundImage:image forState:UIControlStateNormal];
[button addTarget:self action:@selector(checkButtonTapped:event:) forControlEvents:UIControlEventTouchUpInside];
button.backgroundColor = [UIColor clearColor];
cell.accessoryView = button;
return cell;
}
Merci les gars