自定义一个继承于UITextField的TextField, 并重载它的方法
// 覆盖系统方法, 关闭 - 粘贴 剪切 选择 复制等Menu
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
[UIMenuController sharedMenuController].menuVisible = NO;
if (action == @selector(copy:)) {
return NO;
} else if (action == @selector(selectAll:)) {
return NO;
}
return NO;
}