【问题标题】:How to prevent vertical scroll and trigger horizontal by one swipe gesture如何防止垂直滚动并通过一个滑动手势触发水平
【发布时间】:2016-01-14 11:53:14
【问题描述】:

我最近正在开发一个 iOS 应用程序。 我有一个滚动视图,水平包含 3 个视图。 如下图框

View1:(0, 0, ScreenWidth, ScreenHeight)

View2:(ScreenWidth, 0, ScreenWidth, ScreenHeight)

View3:(2 *ScreenWidth, 0, ScreenWidth, ScreenHeight)

在每个视图中,都有一个tableview。

问题是当我尝试在 view2 中滚动 tableview 时,tableview 垂直滚动,在它停止滚动之前,我无法通过滑动手势向左或向右滚动。滑动只会阻止 tableview 滚动,我需要再次滑动才能看到 View 1 或 View3。 我的问题是在 tableview 滚动期间,如何阻止表格滚动并通过一个滑动手势滚动到左视图或右视图? 我检查了APP“Hotel Tonight”可以像我想要的那样工作。但我不知道该怎么做。 欢迎任何意见。

【问题讨论】:

  • 您上面的代码是否设置了这样的值:view1 (x, y, width, height)?
  • 更改视图框架并尝试。 View1:(0, 0, ScreenWidth, ScreenHeight) View2:(ScreenWidth, 0, ScreenWidth, ScreenHeight) View3:(2*ScreenWidth, 0, ScreenWidth, ScreenHeight) 并照顾你的滚动视图 contentSize

标签: ios objective-c uitableview uiscrollview gesture


【解决方案1】:

增加 UITableView 内容高度。

【讨论】:

  • 对不起,我弄错了,框架错了。我纠正它
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-23
  • 1970-01-01
  • 1970-01-01
  • 2012-05-26
相关资源
最近更新 更多