根据用户在tableview中点击(触摸)cell的自定义accessoryButton获得其indexpath
来源:互联网 发布:smt贴片机编程视频 编辑:程序博客网 时间:2024/05/11 00:26
- [button addTarget:self action:@selector(checkButtonTapped:event:) forControlEvents:UIControlEventTouchUpInside];
- cell.accessoryView = button;
- <pre name="code" class="java"></pre><pre name="code" class="java">//转到显示contact详情页面
- - (void)showContact:(tb_Contacts *)contacts animated:(BOOL)animated {
- // Create a detail view controller, set the Contact, then push it.
- EditContactViewController *editContactViewController = nil;
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
- {
- editContactViewController = [[EditContactViewController alloc] initWithNibName:@"EditContactViewController_Ipad" bundle:nil];
- }
- else
- {
- editContactViewController = [[EditContactViewController alloc] initWithNibName:@"EditContactViewController" bundle:nil];
- }
- editContactViewController.contacts = contacts;
- editContactViewController.managedObjectContext = self.managedObjectContext;
- editContactViewController.hidesBottomBarWhenPushed=YES;
- [self.navigationController pushViewController:editContactViewController animated:animated];
- [editContactViewController release];
- }
- //点击详情按钮后走的方法
- - (void)checkButtonTapped:(id)sender event:(id)event
- {
- NSSet *touches = [event allTouches];
- UITouch *touch = [touches anyObject];
- CGPoint currentTouchPosition = [touch locationInView:self.contactsTableView];
- NSIndexPath *indexPath = [self.contactsTableView indexPathForRowAtPoint: currentTouchPosition];
- if (indexPath != nil)
- {
- [self tableView: self.contactsTableView accessoryButtonTappedForRowWithIndexPath: indexPath];
- }
- }</pre><pre name="code" class="java">//选中需要显示contact详情的行走的方法
- - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
- {
- tb_Contacts *contacts = (tb_Contacts *)[fetchedResultsController objectAtIndexPath:indexPath];
- [self showContact:contacts animated:YES];
- }
0 0
- 根据用户在tableview中点击(触摸)cell的自定义accessoryButton获得其indexpath
- 根据用户在tableview中点击(触摸)cell的自定义accessoryButton获得其indexpath
- 根据点击的touch的位置获得tableView的cell
- iOS中获取用户所点击的位置信息,并通过这个位置信息得到tableView的中的cell的indexPath.section
- UITableView获取cell的row值(解决自定义cell里的button通过点击无法获得cell的indexpath的问题)
- UITableView获取cell的row值(解决自定义cell里的button通过点击无法获得cell的indexpath的问题
- UITableView获取cell的row值(解决自定义cell里的button通过点击无法获得cell的indexpath的问题)
- 通过自定义cell添加的button确定其所在cell的indexPath
- IOS应用开发03——自定义Cell的AccessoryButton及事件源被点击的cell行
- 自定义UITableViewCell中获取按钮所在Cell的indexPath
- tableview中indexpath求出点击是哪行哪个
- iOS开发 在cell中找到它在tableView中的indexPath
- iOS 触摸 手势和tableView cell的点击冲突
- 根据indexPath拿到UITableView的cell
- TableView的cell上面加button,实现点击button可以获取到cell的行号或者indexPath
- TableView的cell上面加button,实现点击button可以获取到cell的行号或者indexPath
- 在tableView或者collectionView里如何获得被点击的cell的下标位置
- IOS中点击TableView的Cell跳转
- window server2008 R2 mvc 项目服务器环境的搭建。
- redis.conf配置详解
- 苹果开发 笔记(62)edgesForExtendedLayout
- Ubuntu14.04下安装OpenCV 3.0.RC1
- JackSon 数据之间的转换 java
- 根据用户在tableview中点击(触摸)cell的自定义accessoryButton获得其indexpath
- 基于用户的协同过滤算法
- 基于物品的协同过滤算法
- matlab size,length,numel函数的用…
- Matlab演示Parzen窗法
- matlab 函数meshgrid的用法
- 浅谈支持向量机
- LIBSVM使用方法及参数设置(转)
- 数据库三范式详解