{"id":6538,"date":"2025-09-10T16:59:35","date_gmt":"2025-09-10T08:59:35","guid":{"rendered":"https:\/\/support.fuxinsoft.cn\/?p=6538"},"modified":"2025-09-11T13:43:06","modified_gmt":"2025-09-11T05:43:06","slug":"%e5%9c%a8%e8%87%aa%e5%ae%9a%e4%b9%89item%e7%bb%84%e4%bb%b6%e4%b8%ad%ef%bc%8c%e5%a6%82%e4%bd%95%e6%b7%bb%e5%8a%a0%e6%b8%85%e9%99%a4%e6%ad%a3%e5%9c%a8%e7%bc%96%e8%be%91%e7%9a%84%e9%93%85%e7%ac%94","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=6538","title":{"rendered":"\u5982\u4f55\u5728\u81ea\u5b9a\u4e49 Item \u7ec4\u4ef6\u4e2d\u6dfb\u52a0\u6e05\u9664\u7f16\u8f91\u72b6\u6001\u94c5\u7b14\u6ce8\u91ca\u7684\u529f\u80fd\u6309\u94ae"},"content":{"rendered":"\n<p><strong>\u529f\u80fd\u63cf\u8ff0\uff1a<\/strong> \u5728\u81ea\u5b9a\u4e49 Item \u7ec4\u4ef6\u4e2d\u5b9e\u73b0\u6e05\u9664\u5f53\u524d\u5904\u4e8e\u7f16\u8f91\u72b6\u6001\u7684\u94c5\u7b14\u6ce8\u91ca\u529f\u80fd\uff0c\u5e76\u63d0\u4f9b\u76f8\u5e94\u7684\u64cd\u4f5c\u6309\u94ae<\/p>\n\n\n\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong>\u4ee5\u4e0b\u662f\u57fa\u4e8e Android Compose \u5b9e\u73b0\u8be5\u529f\u80fd\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fun removeAllInk() {\n            var toolHandler = uiExtensionsManager.currentToolHandler;\n            if (toolHandler is InkToolHandler) {\n                toolHandler.addAnnot(true, object :Event.Callback{\n                    override fun result(p0: Event?, p1: Boolean) {\n                        inkList.forEach { annot -&gt;\n                            val ink = annot as Ink\n                            uiExtensionsManager.documentManager.removeAnnot(ink, true,\n                                object : Event.Callback {\n                                    override fun result(event: Event?, success: Boolean) {\n                                        if (success) {\n                                            Log.d(\"RemoveInk\", \"Successfully removed ink annot\")\n                                        }\n                                    }\n                                }\n                            )\n                        }\n                        inkList.clear()\n                    }\n                })\n            }  else {\n                if (inkList.isEmpty()) return\n\n                if (toolHandler is EraserToolHandler) {\n                    uiExtensionsManager.currentToolHandler = null;\n                }\n                inkList.forEach { annot -&gt;\n                    val ink = annot as Ink\n                    uiExtensionsManager.documentManager.removeAnnot(ink, true,\n                        object : Event.Callback {\n                            override fun result(event: Event?, success: Boolean) {\n                                if (success) {\n                                    Log.d(\"RemoveInk\", \"Successfully removed ink annot\")\n                                }\n                            }\n                        }\n                    )\n                }\n                inkList.clear()\n                if (toolHandler is EraserToolHandler) {\n                    uiExtensionsManager.currentToolHandler = toolHandler;\n                }\n            }\n\n        }<\/code><\/pre>\n\n\n\n<p><strong>\u64cd\u4f5c\u8bf4\u660e<\/strong>\uff1a\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u8c03\u7528\u4e86 AnnotHandler.removeAnnot (Annot annot, boolean addUndo, com.foxit.uiextensions.utils.Event.Callback result) \u65b9\u6cd5\uff0c\u5176\u4e2d\u7b2c\u4e8c\u4e2a\u53c2\u6570\u8bbe\u7f6e\u4e3a true\uff0c\u7528\u4e8e\u5c06\u6ce8\u91ca\u79fb\u9664\u64cd\u4f5c\u7eb3\u5165\u64a4\u9500\u6808\uff0c\u4ece\u800c\u652f\u6301\u64a4\u9500\u529f\u80fd\u3002\u5728\u5b8c\u6210\u6ce8\u91ca\u6e05\u9664\u64cd\u4f5c\u540e\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5207\u6362\u56de\u4e4b\u524d\u4f7f\u7528\u7684 ToolHandler\uff0c\u786e\u4fdd\u64cd\u4f5c\u8fde\u8d2f\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u529f\u80fd\u63cf\u8ff0\uff1a \u5728\u81ea\u5b9a\u4e49 Item \u7ec4\u4ef6\u4e2d\u5b9e\u73b0\u6e05\u9664\u5f53\u524d\u5904\u4e8e\u7f16\u8f91\u72b6\u6001\u7684\u94c5\u7b14\u6ce8\u91ca\u529f\u80fd\uff0c\u5e76\u63d0\u4f9b\u76f8\u5e94\u7684\u64cd\u4f5c\u6309\u94ae \u89e3\u51b3\u65b9\u6848\uff1a [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85],"tags":[962,990,963,591,505,991,374,989,941,942],"class_list":["post-6538","post","type-post","status-publish","format-standard","hentry","category-rdk-android","tag-android-compose","tag-removeannot","tag-toolhandler","tag-591","tag-505","tag-991","tag-374","tag--item-","tag-item","tag-942"],"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","_links":{"self":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/6538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6538"}],"version-history":[{"count":2,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/6538\/revisions"}],"predecessor-version":[{"id":6554,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/6538\/revisions\/6554"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}