UIMenuController - customization
As os 3.2, we are allowed to change the editing menu. This is what the documentation states:
"You may create your own menu items, each with its own title and action selector, and add them to the editing menu through this property. Custom items appear in the menu after any system menu it开发者_开发百科ems."
I would like to remove those 'system items' (they are a lot!), or part of them. What should I do?
You control which ones are visible with canPerformAction, such as:
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
BOOL answer = NO;
if (action == @selector(copy:))
answer = YES;
return answer;
}
The above code will allow the copy, but none of the others. You can also add in your custom UIMenuItem too.
精彩评论