Questions tagged [uimenucontroller]

The singleton UIMenuController instance presents the menu interface for the Cut, Copy, Paste, Select, Select All, and Delete commands. This menu is referred to as the editing menu. When you make this menu visible, UIMenuController positions it relative to a target rectangle on the screen; this rectangle usually defines a selection. The menu appears above the target rectangle or, if there is not enough space for it, below it.

The singleton UIMenuController instance presents an Editing Menu. You can create an instance like this

    UIMenuController *menuController = [UIMenuController sharedMenuController]; 

You can position it relative to a target rectangle on the screen which usually defines a selection.

An example implementation of UIMenuController (assuming you are coding for at least iOS 3.2 ()):

    UIMenuController *menuController = [UIMenuController sharedMenuController];
    UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"title" action:@selector(aMethod:)];
    UIMenuItem *menuItem1 = [[UIMenuItem alloc] initWithTitle:@"title" action:@selector(anotherMethod:)];
    [menuController setMenuItems:[NSArray arrayWithObjects:menuItem, menuItem1, nil]];
    [menuController setTargetRect:CGRectMake(location.x, location.y, 0, 0) inView: someView];
    [menuController setMenuVisible:YES animated:YES];
    menuController.arrowDirection= UIMenuControllerArrowLeft; 
    [resetMenuItem release];

References:

277 questions
0
votes
1 answer

UITextView Copy option not showing in top iPhone app?

Am working in message based iPhone app. I have added UITextView to show the messages typed by the user. This app allows the user to copy the messages. Whenever the user selects the messages in the bubbles the Copy option showing in middle of…
Gopinath
  • 5,392
  • 21
  • 64
  • 97
0
votes
2 answers

Determine the Cell of TableView on which UIMenuItem was selected

I am displaying a context menu on the cells of a table view using UIMenuController. UIMenuItem *ren = [[UIMenuItem alloc] initWithTitle:@"Rename" action:@selector(onRenameItem:)]; /* .... then set menu visible on long press ...*/ the…
Husain Basrawala
  • 1,757
  • 15
  • 21
0
votes
1 answer

How to copy selected data from a PDF displayed in a UIWebView

I am working on a project that displays a PDF in a UIWebView. I have added another UIMenuItem to the UIMenuController in order to do various things with the text in the UIWebView that has been selected. The problem is that I am not able to access…
bbrownd
  • 525
  • 1
  • 6
  • 14
0
votes
1 answer

iPhone SDK: UIMenuController to popup above selected UITableCell

I am trying to have the UIMenuControl popup above whatever cell is selected by the user.... Currently I have this code below, which always puts the UIMenuControl in the middle of the screen on an iPhone... - (void)tableView:(UITableView *)tableView…
OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39
-1
votes
1 answer

UIMenuController does not show on iOS 4, but works on iOS 5

In a custom view i have set 'canBecomeFirstResponder' to return YES and have also defined '- (BOOL)canPerformAction:(SEL)action withSender:(id)sender' I use the following code to display the popup menu: [self becomeFirstResponder]; UIMenuController…
nassos
  • 86
  • 2
  • 9
-1
votes
1 answer

UIButton and Temporary UIMenu

Can you change whether a UIButton has a UIMenu or not depending on external conditions? let infoButton = UIButton() infoButton.showsMenuAsPrimaryAction = true infoButton.menu = UIMenu(options: .displayInline, children:…
Gizmodo
  • 3,151
  • 7
  • 45
  • 92
-1
votes
1 answer

ios how to show modal view on clicking uimenuitem

I am developing an app where on click of table cell i am displaying UIMenuItem with 'Info' button. Now on clicking the info button i have to show a view and dismiss on click of cancel. In MytableView(Custom tableView) -(void)tableView : (UITableView…
Vidhyanand
  • 5,369
  • 4
  • 26
  • 59
1 2 3
18
19