我不希望在选择文本时出现“复制/定义”按钮。
我如何在 objective-c 中做到这一点?
更新:我想在 UIWebView 中这样做
Best Answer-推荐答案 strong>
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
从这个 question 回答发表者rpetrich
关于ios - 在 objective-c 中选择文本时,如何防止出现复制按钮?,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/30876386/
|