【发布时间】:2018-01-27 03:21:32
【问题描述】:
我以这种方式在 uiviewconroller 中显示 UIMenuController:
在我的课堂上:
override open func canBecomeFirstResponder() -> Bool {
return true
}
open override func canPerformAction(_ action: Selector, withSender sender: Any) -> Bool {
//here I check for my custom action, else return false
return false
}
然后显示我使用:
//Make this as first responder
self.becomeFirstResponder()
///Build menu
let menu = UIMenuController.shared
///Set item and anchor point, and showit
menu.menuItems = itemsToAdd
menu.setTargetRect(CGRect(x: 0, y: 5, width: bubbleNode.view.bounds.size.width, height: bubbleNode.view.bounds.size.height), in: bubbleImageNode.view)
menu.setMenuVisible(true, animated: true)
问题是在设备中我显示我的自定义项目,而且:“拼写,说话,斑点句子,ecc...”我该如何禁用它?
【问题讨论】:
-
菜单没有会员代表
-
你的控件是 UITextView 吗?
-
是ASCellNode,一个来自AsyncDisplayKit的collectionviewcell
标签: ios swift uimenucontroller