iOS选项弹出窗口 - 类似于剪切/复制/粘贴 [英] iOS Option Popup - Similar to Cut/Copy/Paste

查看:579
本文介绍了iOS选项弹出窗口 - 类似于剪切/复制/粘贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我正在开发的应用程序,我需要一些弹出选项,类似于在UITextView或UIWebView中选择文本时显示剪切/复制/粘贴的方式。

For an app I'm developing I need some popup options, similar to how Cut/Copy/Paste is displayed when selecting text in a UITextView or UIWebView.

但是,我很难找到这种弹出窗口的名称。是否有公共API,或者它是否必须从头开始实现?

However, I'm having trouble finding what this kind of popup is called. Is there a public API for them, or is it something that has to be implemented from scratch?

推荐答案

你想要的课程看看是UIMenuController。

The class you want to look at is UIMenuController.

如果内存服务,则需要创建一个UIMenuItem实例数组来描述自定义操作,并使用'setMenuItems:'将它们添加到UIMenuController单例中。

If memory serves, you will need to create an array of UIMenuItem instances to describe the custom actions, and add them to the UIMenuController singleton using 'setMenuItems:'.

这篇关于iOS选项弹出窗口 - 类似于剪切/复制/粘贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆