ios - 一个 UITableView 嵌入了一个 UIScrollView,滑动删除是行不通的

标签 ios uitableview uiscrollview

尝试了很多方法都没有解决

就我而言,我的 View 层次结构:

UIView
  UIScrollView
  LeftContainer + RightContainer
                (in RihgtContainer) ViewContainer 
                                      TableView

enter image description here

我试过这些:

子类化 Scrollview 和

 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.nextResponder touchesBegan:touches withEvent:event];
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
   if(!self.dragging)
    {
        [self.nextResponder touchesMoved:touches withEvent:event];
    }
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.nextResponder touchesEnded:touches withEvent:event];

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer


innerTableView.scrollEnabled = YES;
innerTableView.alwaysBounceVertical = NO;

最佳答案

您可以通过托盘将 ScrollView 上的 delaysTouchesBegan 设置为 true... 就像这里 https://stackoverflow.com/a/31040918/1702413

但是 .. UITableview 继承自UIScrollView

您不应在 UIScrollView 对象中嵌入 UIWebViewUITableView 对象 https://stackoverflow.com/a/17121582/1702413

关于ios - 一个 UITableView 嵌入了一个 UIScrollView,滑动删除是行不通的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35521168/

相关文章:

iphone - 在 uitableviewcell 内滚动时防止表格 View 滚动

ios - 滚动tableView时,如何知道哪个单元格触摸了绿色区域

objective-c - 为什么我向同一个方向快速滑动两次时,UIScrollView 会剧烈滚动?

ios - 使 UIScrollView 平滑滚动

ios - UICollectionCell 调用 CollectionViewController 中的方法

ios - UISearchBar 在 iOS 8 中隐藏

iphone - 自定义 uitableviewcell 中的导航

ios - 自定义 UITableViewCells 以及正确使用prepareForReuse和removeFromSuperview

ios - 编辑按钮未显示在 UITabBarController 的 MoreNavigationController 中

ios - UITableView prepareForSegue 没有推送到 UIWebView