Voici mon code.Am très nouveau à Xcode.When je tape sur la cellule tableview suis UIActionSheet. Pour rejeter UIActionSheet j'ai utilisé UITapGestureRecognizer.Il ne fonctionne pas pour moi.Comment rejeter la feuille d'actions dans tableviewcell quand je tape sur la vue dans ios
- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [aTableView cellForRowAtIndexPath:indexPath];
UILabel *lbl = (UILabel *)[cell.contentView viewWithTag:2];
NSLog(@"cell text label =%@",lbl.text);
_StoreNameobj = lbl.text;
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Store Maintenance Action"
delegate:self
cancelButtonTitle:cancelTitle
destructiveButtonTitle:nil
otherButtonTitles:@"Show Store Details",@"Navigate to Store",@"Edit Store Nickname",@"Delete Store", nil];
actionSheet.userInteractionEnabled = YES;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapOut:)];
[lbl addGestureRecognizer:tapGesture];
[cell.contentView addSubview:lbl];
}
- (void)tapOut{
//dismiss the action sheet here
[actionSheet removeFromSuperview];
}
Toute aide est appréciable.Merci à l'avance!
pourquoi vous ne pouvez pas utiliser '' didSelectRow' ou UIButton' de rejeter – Shubhank
Il n'y a pas besoin de prendre le geste du robinet sur la feuille d'action. Son comportement par défaut est de le rejeter au clic. – Lion
Comment utiliser didSelectRow de rejeter ActionSheet @Shubhank – srinitha