我使用PDFView,并尝试更改滚动动画pagecrul。
func configurPdfView(actualPath:URL){
self.pdfView = PDFView()
if let document = PDFDocument(url: actualPath) {
pdfView.autoresizesSubviews = true
pdfView.autoresizingMask = [.flexibleWidth, .flexibleHeight, .flexibleTopMargin, .flexibleLeftMargin]
pdfView.displayDirection = .horizontal
pdfView.autoScales = true
pdfView.displaysRTL = true
pdfView.displayMode = .singlePage
pdfView.displaysAsBook = true
pdfView.usePageViewController(true)
pdfView.document = document
pdfView.backgroundColor = .clear
pdfViewContainer.layer.masksToBounds = false
pdfViewContainer.layer.shadowOffset = CGSize(width: 0, height: 7)
pdfViewContainer.layer.shadowRadius = 10
pdfViewContainer.layer.shadowOpacity = 0.16
NotificationCenter.default.addObserver(self, selector: #selector(updatePageChange), name: .PDFViewPageChanged, object: nil)
}
}
我尝试这样做,但没有成功。
pdfView.usePageViewController(true, withViewOptions:[UIPageViewController.TransitionStyle.pageCurl : 0])
或者这个:
pdfView.usePageViewController("TransitionStyle": UIPageViewController.TransitionStyle.pageCurl])