Je tente d'implémenter un menu déroulant comme dans l'application facebook.Cell spécifique Action comme le menu déroulant
J'ai une NIB pour un UITableViewCell personnalisé, qui comprend un bouton. Le bouton a un IBAction qui lui est associé, dans lequel j'anime dans une sous-vue de mon NIB (le menu delete/edit). Mon problème est que mon animation se produit uniquement sur une cellule, et ce n'est pas la cellule où j'ai appuyé sur le bouton. Comment est-ce que j'appellerais cette animation pour travailler sur la cellule où mon bouton a été tapé? Voici mon code jusqu'à maintenant. Des conseils?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *PatientCellIdentifier = @"PatientCellIdentifier";
PatientListTableViewCell *cell = (PatientListTableViewCell *)[tableView dequeueReusableCellWithIdentifier:PatientCellIdentifier];
if (cell ==nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"PatientCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cellBG.png"]];
}
//NSUInteger row = [indexPath row];
//NSDictionary *rowData = [self.
[self configureCell:cell atIndexPath:indexPath];
return cell; }
-(IBAction)showMenu:(id)sender{
[self showMenuForCell:sender animated:YES];}
- (void)showMenuForCell:(UITableViewCell *)cell animated:(BOOL)animated {
//[super showMenu:view forCell:cell animated:animated];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];
//Action here
[UIView commitAnimations];
}