1
我使用PDFKit for iOS 11,使用搜索功能,我得到了一些PDFSelection
元素。如何在PDF中突出显示与此选择对应的文本?如何突出显示PDFKit中的搜索结果 - iOS
我想这一点,但不工作:
selection.color = UIColor.red
selection.draw(for: selection.pages.first!, active: true)
我使用PDFKit for iOS 11,使用搜索功能,我得到了一些PDFSelection
元素。如何在PDF中突出显示与此选择对应的文本?如何突出显示PDFKit中的搜索结果 - iOS
我想这一点,但不工作:
selection.color = UIColor.red
selection.draw(for: selection.pages.first!, active: true)
你忘了添加选择到PDFView:
@IBOutlet weak var pdfView: PDFView!
pdfView.setCurrentSelection(selection, animate: true)
而且它看起来像selection.draw
是没有必要的一步。