如何为PDFView usePageViewController和ViewOptions定义选项字典:

时间:2019-02-12 22:38:37

标签: ios ios-pdfkit apple-pdfkit

如何为PDFKit中的PDFView的pageViewController定义选项字典?

  

我对此标志感兴趣

     

UIPageViewController.NavigationOrientation.horizo​​ntal

let pdfv = PDFView.init(frame: self.view.frame)

let opt = ?????

pdfv.usePageViewController(true, withViewOptions: opt)

1 个答案:

答案 0 :(得分:1)

ViewOptions仅包含2个选项:interPageSpacingspineLocationhttps://developer.apple.com/documentation/uikit/uipageviewcontroller/optionskey

示例:pdfv.usePageViewController(true, withViewOptions: ["interPageSpacing": 50])

如果要将pageViewController的方向更改为水平,请使用以下代码:

pdfv.displayDirection = .horizontal

希望这会有所帮助。