简体   繁体   English

如何在UIwebview上添加注释并突出显示

[英]How to add a note and highlight on UIwebview

I would like to implement a function like adding a note of a selected text on UIWebview as iBooks and Kobosoft reader 我想实现一个功能,例如在iWebs和Kobosoft Reader中在UIWebview上添加选定文本的注释

I already created UIMenuItem. 我已经创建了UIMenuItem。 But, I don't know how to implement the method for this. 但是,我不知道如何实现该方法。 Could anybody help in this regard? 在这方面有人可以帮忙吗?

I don't know what functionality is used to implement to add note and highlight text as well as store and retrieve 我不知道用于添加注释和突出显示文本以及存储和检索的功能是什么

UIWebView is implemented in such a way that you may be able to add notes to a certain portion of the text of a web page or PDF loaded into the view, but highlighting is impossible because the APIs don't allow it. UIWebView的实现方式是,您可以向网页或加载到视图中的PDF的文本的特定部分添加注释,但是由于API不允许突出显示,因此无法进行突出显示。 iBooks and Kobo (and kindle to some extent) utilize a combination of the CGPDF APIs and a little Core Animation magic for the highlighting of PDFs, and store it in the metadata of the PDF. iBooks和Kobo(在某种程度上)将CGPDF API和一点Core Animation魔术结合使用来突出显示PDF,并将其存储在PDF的元数据中。 Reading and writing to the metadata store is easy, however rendering the highlights is a challenge that involves some interesting math . 读取和写入元数据存储很容易,但是呈现突出显示是一项挑战,其中涉及一些有趣的数学运算

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM