Search code examples
objective-ciosuiwebviewuimenucontroller

UIMenu buttons disappear after usage


I've customized UIMenuController like this:

UIMenuItem* note = [[[UIMenuItem alloc] initWithTitle:@"Note action:@selector(noteItemTapped:)] autorelease];
UIMenuItem* share = [[[UIMenuItem alloc] initWithTitle:@"Share" action:@selector(shareItemTapped:)] autorelease]; 
[[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObjects:note, share, nil]];
[[UIMenuController sharedMenuController] update];

and in UIWebView it work, but with some problems: 1) After some usings only default "Copy" button is shown 2) They don't on touch (I have a UITapGestureRecognizer added to my view) but if I touch and drag a little, they ok.

Can anyone provide me with some tutorials of such customizing or give some your suggestions about problems?


Solution

  • Here is a Stackoverflow Answer that should solve your problem:

    UIMenuController not showing up