1

我正在研究 PDFKit 并尝试旋转页面。它旋转良好,但不使用 usePageViewController。使用 usePageViewController 它不会更新页面的框架。

// At defining PDFVIEW object
pdfView.displayMode = .singlePageContinuous
pdfView.usePageViewController(true, withViewOptions: nil)
// For rotating screen
pdfView.currentPage?.rotation += 90

没有 usePageViewController 分页不起作用。如何在同一个地方实现两者。

https://i.stack.imgur.com/xifjV.jpg

https://i.stack.imgur.com/HUogU.jpg

4

1 回答 1

1

你可以做一个技巧,它对我有用:)。更改旋转集之前

    usePageViewController(false) 

在那之后

    usePageViewController(true)
guard let currentPage = self.pdfView.currentPage else {return}
self.pdfView.usePageViewController(false)
self.angle = self.angle + 90
currentPage.rotation = self.angle
self.pdfView.usePageViewController(true)
self.pdfView.autoScales = true
self.pdfView.go(to: currentPage)
于 2020-08-27T09:44:09.610 回答