【问题标题】:How to enable selection of continous text in PDFView so that I can add annotations?如何在 PDF 视图中启用连续文本选择以便我可以添加注释?
【发布时间】:2019-01-16 20:04:45
【问题描述】:

目前我已经使用 PDFDocument 在 PDFView 上呈现了一个示例 pdf 文件。

pdfView.autoScales = true
pdfView.displayDirection = .horizontal
pdfView.displayMode = .singlePage
pdfView.usePageViewController(true, withViewOptions: [UIPageViewControllerOptionInterPageSpacingKey: 20])
pdfView.document = pdfDocument

所以当我在视图上滑动时,它会在我使用 pageViewController 时分别滑到下一页或上一页。

问题就出现在这里,

如果我想注释文本的某些部分,那么当我开始拖动文本时,它会滑动到下一页而不是连续选择文本。

如果我长按,那么我只能选择一个单词或使用 Copy 选择本机操作系统,Selectall 会弹出,这不是我的要求。

当用户开始选择文本时,我需要添加高亮注释。

【问题讨论】:

    标签: ios objective-c swift apple-pdfkit


    【解决方案1】:

    对于仍然被上述问题困扰的任何人,解决方案只是一条线

    pdfView!.isUserInteractionEnabled = !pdfView.isUserInteractionEnabled
    

    将禁用 pdfview 子视图的滚动。

    要启用回滚,只需使用上面提到的同一行。

    【讨论】:

      猜你喜欢
      • 2019-12-03
      • 2013-05-24
      • 1970-01-01
      • 2013-05-03
      • 2017-06-03
      • 2012-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多