swift - 如何让 UIPageViewController 使用 Transition Style Scroll?

标签 swift xcode uipageviewcontroller

关于这个话题有很多问题,而且大部分答案都过时了,所以我要发布这个问题。

使用 Swift 5.1 运行 Xcode 10.2.1。

我有一个 UIPageViewController,我在属性检查器中将过渡样式设置为滚动。

enter image description here

但是,当我在模拟器中运行该应用程序时,会发生页面 curl 。

enter image description here

是否有程序化的方法来确保过渡样式是滚动的?

最佳答案

只需添加初始化代码并以编程方式初始化过渡样式。

required init?(coder aDecoder: NSCoder) {
    super.init(transitionStyle: .scroll, navigationOrientation: .horizontal, options: nil)
}

enter image description here

关于swift - 如何让 UIPageViewController 使用 Transition Style Scroll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56777647/

相关文章:

ios - 覆盖 AVCaptureVideoPreviewLayer

ios - 在 UIPickerView 问题中选择第一行

ios - iOS 应用中的形状

objective-c - 带有渐变叠加的 UIPageViewController?

ios - UIPageViewController 中 WebView 的滚动问题

swift - 如何在 Swift 中删除字符串中的重复字符

ios - XCTest 用于测试模型对象

ios - Alamofire 在我的项目中不起作用

iphone - iPhone 版 Google Analytics(分析)上的 trackPageView 不工作

swift - 如何为 UITableView 中的每个部分启用水平分页