【发布时间】:2017-11-24 08:51:56
【问题描述】:
我在 iOS 上使用 PDFKit 来突出显示文本(PDF 文件)。我通过创建 PDFAnnotation 并将其添加到选定的文本区域来做到这一点。我想精确地突出显示选定的区域,但它总是覆盖整条线,如下图所示。如何只为选定区域创建注释??
我的代码:
let highlight = PDFAnnotation(bounds: selectionText.bounds(for: page), forType: PDFAnnotationSubtype.highlight, withProperties: nil)
highlight.color = highlightColor
page.addAnnotation(highlight)
【问题讨论】: