Ios 获取UITableViewCell中的触摸位置
我正在使用Ios 获取UITableViewCell中的触摸位置,ios,uitableview,menu,Ios,Uitableview,Menu,我正在使用UITableView代理显示UIMenuController - (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(5_0){ return YES; } - (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action
UITableView
代理显示UIMenuController
- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(5_0){
return YES;
}
- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender NS_AVAILABLE_IOS(5_0){
if(action == @selector(copy:)){
return YES;
}
return NO;
}
- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender NS_AVAILABLE_IOS(5_0){
if(action == @selector(copy:)){
NSLog(@"Action");
}
}
但是,有没有办法在
UITableViewCell
中获取触摸位置?最简单的方法是:创建自定义UITableViewCell,在您关心某人触摸的“热点”上有清晰(不可见)的按钮 为什么你需要知道菜单是从哪里来的?根据您的需要,可能还有其他解决方案。我想在UItableviewCell中的指定部分显示menuController。。