简体   繁体   English

从UiMenucontroller隐藏复制选项

[英]Hide copy option from UiMenucontroller

I want to remove copy and define option from UIMenuViewcontroller 我想从UIMenuViewcontroller删除复制并定义选项

i checked on Google and got the i have to override below method in my class and done same 我在Google上进行了检查,并得到了我必须在我的课堂上覆盖以下方法的信息,并完成了

Add below in subclass of UIWebView UIWebView子类中添加以下内容

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender{
 NSLog(@"action=========%@",NSStringFromSelector(action));
     if(action == @selector(copy:)
        return NO;

    }

But i am not getting ant option named copy: but getting all other like cut:, paste:, select: etc, but copy: option is not coming, so i cant hide the copy option until i get copy option in above method 但是我没有得到名为copy:的蚂蚁选项,而是得到了所有其他类似cut:,paste:,select:等的选项,但是copy:选项没有出现,因此我无法隐藏copy选项,直到我在上述方法中获得copy选项为止

Please tell me what i have to do , why copy option is not coming 请告诉我我该怎么办,为什么不提供复印选项

i am getting below actions there is no copy action 我正在执行以下操作,没有复制操作

2014-02-13  action=========cut:

2014-02-13  action=========select:

2014-02-13  action=========selectAll:

2014-02-13  action=========paste:

2014-02-13  action=========delete:

2014-02-13  action=========_promptForReplace:

2014-02-13  action=========_showTextStyleOptions:

2014-02-13  action=========_addShortcut:

2014-02-13  action=========_accessibilitySpeak:

2014-02-13  action=========_accessibilitySpeakLanguageSelection:

2014-02-13  action=========_accessibilityPauseSpeaking:

2014-02-13  action=========makeTextWritingDirectionRightToLeft:

2014-02-13  action=========makeTextWritingDirectionLeftToRight:

Add call [super canPerformAction:action withSender:sender] to your implementation 将调用[super canPerformAction:action withSender:sender]到您的实现中

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {  
    if (action == @selector(copy:))
    {
        return NO;
    }
    return [super canPerformAction:action withSender:sender];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM