我顯示了在uiviewconroller這樣一個UIMenuController: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 –