我想从UIMenuController中删除一些默认的UIMenuItem对象,如"剪切","复制"等.
怎么做 ?
谢谢.
对显示菜单的视图(例如UIWebView,UITextView)进行子类化,并覆盖-canPerformAction:withSender:以返回NO您不想显示的菜单项.
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
if (action == @selector(copy:)) {
return NO;
}
else {
return [super canPerformAction:action withSender:sender];
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2354 次 |
| 最近记录: |