我不希望在选择文本时出现“复制/定义”按钮。 我如何在 objective-c 中做到这一点?
更新:我想在 UIWebView 中这样做
The easiest way to disable pasteboard operations is to create a subclass of UITextView that overrides the canPerformAction:withSender: method to return NO for actions that you don't want to allow:
- (BOOL)canPerformActionSEL)action withSenderid)sender
{
if (action == @selector(paste)
return NO;
return [super canPerformAction:action withSender:sender];
}
另见 UIResponder
关于ios - 在 objective-c 中选择文本时,如何防止出现复制按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30876386/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |