ios - 在 UIPageViewController 中使用 UISlider

标签 ios swift xcode8 uipageviewcontroller uislider

我在 XCode 8/Swift 3 中工作。我有一个附加了三个页面的 UIPageViewController,在第三页上有一个 UISlider。当您想要滑动元素时,触摸会触发 PageViewController 并移动页面而不是 slider 。您需要触摸它一秒钟左右才能移动它。

我找到了 this但这个解决方案已有 3 年历史,我无法将其转换为当前语法。我找不到任何当前示例。

最佳答案

这是从另一个问题中接受的 Objective-C 的 Swift 翻译

for view in pageViewController.view.subviews {
   if view is UIScrollView {
      (view as? UIScrollView)?.delaysContentTouches = false
   }
}

关于ios - 在 UIPageViewController 中使用 UISlider,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43416456/

相关文章:

ios - iOS 版 SDK 3.0 Beta 中的 FQL

ios - 在 Swift 1.2 中获取触摸坐标

ios - 通过代码生成导航栏 View (不使用 Storyboard)

c++ 在同一行使用 cout 和 cin 的问题 (xcode8)

ios - 替换 iOS 中保留的 "description"的字段的适当名称是什么?

ios - Collection View ( Collection View ,didSelectItemAt : indexPath) - Cannot call value of non-function type 'UICollectionView

ios - 离线时准确的时间检测

ios - GoogleMobileAds 的 undefined symbol 问题

ios - 不同设备的不同设置?

ios - 解析包含 'T' 和 + 时区偏移量的日期字符串