ios - UIPageViewController 上未选择 UITableView didSelectRowAtIndexPath

标签 ios objective-c ios6

我有一个 UIViewController,其中添加了 UIPageViewController 的 View 。该 UIPageViewController 有一个带有 subview 的页面,该 subview 将 UITableView 添加为 subview 。我正在使用 iOS 6,单击单元格时没有调用方法 didSelectRowAtIndexPath。但是有一个奇怪的“错误”......如果我将页面翻到一半然后回到我所在的页面(没有完成翻页),那么我就可以选择单元格。我认为这与手势识别器有关,但我无法弄清楚。我尝试从 UIPageViewController 的实例化中删除手势识别器,但无法使其正常工作。

我像这样从 UIPageViewController 中删除了点击手势识别器,但仍然存在错误行为......

for (UIGestureRecognizer *recognizer in pageViewController.gestureRecognizers) {
    if ([recognizer isKindOfClass:[UITapGestureRecognizer class]]) {
        recognizer.enabled = NO;
    }
}

有什么建议么?

最佳答案

子类 UIViewUITableView .比方说myUIView .

myUIView 中实现 UITableView 委托(delegate).

添加 myUIView作为 UIPageControl 的 subview .

UITableView 代表 myUIView会触发。

关于ios - UIPageViewController 上未选择 UITableView didSelectRowAtIndexPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15396906/

相关文章:

iphone - 无法调用 UIKeyboard 通知

ios - 使用 Pinterest SDK 发送到释放实例的消息

ios - 粒子过滤器 iOS 实现失败

ios - 选中时突出显示集合单元格

ios - 如何使用委托(delegate)/协议(protocol)在多个 View Controller 之间传递值

iphone - 为 ios 视网膜应用程序添加图像两次?

ios - 调动 NSObject 的 performSelector :withObject: gives EXC_BAD_ACCESS why?

iphone - 如何第一次创建 iPhone 数据库?

ios - 数据未添加到 Plist

iphone - 表格单元格指示器问题