uiwebview 中的 uimenucontroller 带有自定义菜单项,没有更多菜单
在我的 iPad 应用程序中,有一个显示文本内容的 UIWebview。当我点击按住并选择文本时,应该会弹出一个菜单,其中包含 2 个自定义菜单。
说, |菜单1 |菜单2 |
但似乎“复制”菜单也会随之出现,但我无法禁用它。有没有可能禁用它?我在论坛上尝试过,但没有找到解决方案。
所以可以将“复制”菜单与其他 2 个菜单一起保留。现在应该看起来像
|复制|菜单1 |菜单2 |
但不幸的是,我让它显示更多菜单,如下所示
:复制|更多... |
单击“更多...”菜单将显示另外 2 个菜单。
但我需要在第一次尝试中显示所有这两个项目。要么只有 2 个菜单,要么至少和复制菜单一起。
|复制|菜单1 |菜单2 |
或
|菜单1 |菜单2 |
请给我一些解决方案......以多种方式尝试......但没有任何结果...... 请帮助我...
谢谢, 布莱恩
In my iPad app, there is a UIWebview that displays text content. When I tap hold and select a text, a menu should popup with 2 custom menu.
say, | MENU1 | MENU2 |
But it seems the COPY menu will also accompany, which I couldn't disable. Is there any possibilities to disable it? I tried around the forum and no solutions worked out.
so itz okay to keep the COPY menu along with the other 2. which should now look like
| Copy | MENU1 | MENU2 |
But unfortunately, I 'm getting it displayed with a MORE menu as follows :
| Copy | More... |
Clicking the More... menu is showing the other 2 menu.
But I need all those 2 items to be displayed in the first attempt itself. either just the 2 menus alone, or atleast along with the copy menu.
| Copy | MENU1 | MENU2 |
OR
| MENU1 | MENU2 |
Get me some solution please.... Trying it out in many ways.. But nothing is working out...
Plz help me out...
Thanks,
Brian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎没有办法在不替换 UIMenuController 的情况下做到这一点。一种选择是处理您自己的 UILongPressGestureRecognizer (请参阅 如何删除 COPY UIMenuItem在 UIMenuController 中)。我见过重写 canPerformAction 的提案,但这不起作用。有趣的是,“复制:”操作从未被调用,尽管似乎其他所有操作(剪切:、选择:等)都被调用。
`
It doesn't appear that there is a way to do this without replacing the UIMenuController. One option is to handle your own UILongPressGestureRecognizer (see How to remove th COPY UIMenuItem in UIMenuController). I've seen proposals where you override canPerformAction, but this does not work. Interestingly, the "copy:" action is never called, though it seems that everything else (cut:,select:,etc.) is.
`