我想禁用复制/粘贴菜单,并且我在 UITextView 中使用 HTML 标记,其中有多个超链接并且只想禁用菜单.
I want to disable copy/paste menu and i'm using HTML tag in UITextView in which multiple hyperlinks and want to only disable menu.
我的 texview 图片
My texview image
只需尝试创建一个覆盖 canPerformAction:withSender: 方法的 UITextView 的子类
just try to create a subclass of UITextView that overrides the canPerformAction:withSender: method
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
if (action == @selector(paste:))
return NO;
return [super canPerformAction:action withSender:sender];
}
这篇关于如何禁用 UITextview 选择文本,复制/粘贴 UIMenuController 但仍然有超链接工作 [不重复]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何通过点击动画 UIImageview 以显示全屏?How to animate a UIImageview to display fullscreen by tapping on it?(如何通过点击动画 UIImageview 以显示全屏?)
停止 segue 并显示警报To stop segue and show alert(停止 segue 并显示警报)
iOS 5 故事板,以编程方式确定路径iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以编程方式确定路径)
图标已经包含光泽效果Icon already includes gloss effects(图标已经包含光泽效果)
UIEdgeInsetsMake 是如何工作的?How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
UIProgressView 和自定义跟踪和进度图像(iOS 5 属性UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定义跟踪和进度图像(iOS 5 属性))