ios - 在 UITableviewCell 中嵌入的 UITableView 中滚动(ios7)

标签 ios ios7 uitableview

我将 UITableView 添加为 UITableviewCell 的 subview 。 在 iOS 6 中,当我滚动内部 tableView 并到达它的末尾时,主 TableView 变为滚动。 在 iOS 7 中,它不再起作用。如果我在内部 TableView 中滚动,它不会将此滚动事件传递给父 tableView。

有谁知道如何简单地修复它,而无需手动将事件从内部 TableView 传输到父级?

附加信息: 我找到了 problem 的可能原因.但是如何解决这个问题。

最佳答案

所以,我找到了解决办法。

根据@FaisalAli 的提示,我实现了委托(delegate)方法:

- (BOOL)                         gestureRecognizer: (UIGestureRecognizer*)gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer*)otherGestureRecognizer
{
    if ([gestureRecognizer isKindOfClass: [UIPanGestureRecognizer class]])
    {
        if ([((UIPanGestureRecognizer*)gestureRecognizer) velocityInView: self].y > 0)
        {
            // Up
            if (self.contentOffset.y <= 0)
            {
                self.bounces = NO;
                return YES;
            }
        }
        else
        {
            // Down
            if (self.contentOffset.y + self.height >= self.contentSize.height)
            {
                self.bounces = NO;
                return YES;
            }
        }
    }

    self.bounces = YES;

    return NO;
}

这很有帮助。

关于ios - 在 UITableviewCell 中嵌入的 UITableView 中滚动(ios7),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22859627/

相关文章:

ios - 当尝试从 Controller 更改该单元格中的 UITextField 时,UICollectionView 中的单元格返回 nil

ios - 在 Textview 中添加 Carousel View

ios - 在 iOS 7 中编辑时,UITextView 光标定位不正确。为什么?

ios - 只有最后一个 uitableview 单元格是正确的,其余显示空项目

ios - 登录 iOS 应用程序

ios - Apple 开发者帐户对可以管理的帐户数量有限制吗?

uinavigationbar - iOS7GM UINavigationBar外观setBackgroundImage : forBarMetrics: not working in UIPopoverController

iOS - 使用用户名和密码登录 Twitter

ios - UISegmentedControl 在值更改时未选择

ios - 分组 TableView - 了解选择了哪个单元格