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
0 answers

Pin a saved notes in UIWebView

I have UIWebView for displays HTML articles. When user touch some area in UIWebView, UIMenuController will display. Then user select note button it displays UITextView, then user can able to write some text, after that user can store the text to…
user2807197
  • 207
  • 1
  • 4
  • 12
0
votes
1 answer

select text inside UIWebView using singleTap

I have UIWebView for displaying articles. These are all HTML pages. I need to select text from articles. So, i'm using UIMenucontroller for select option. I need to select text while user tap on singleTap. But when use singleTap nothing…
0
votes
1 answer

Remove copy and define from UIMenuController

I have UIWebView for displaying some articles. I need to select some text from UIWebView and use bookmark. So i'm using selection = [wbCont stringByEvaluatingJavaScriptFromString:@"window.getSelection().toString()"]; But when i longpress the…
user2807197
  • 207
  • 1
  • 4
  • 12
0
votes
1 answer

Order of UIMenuItems in custom edit menu

I want to add my own commands to the selection menu, but also keep the standard "copy", "cut", etc. commands. I use this: UIMenuItem *myItem = [[UIMenuItem alloc] initWithTitle:@"My Command" action:@selector(myCommand:)]; [[UIMenuController…
illyge
  • 183
  • 1
  • 8
0
votes
1 answer

Edit and delete a UITableView row using UIMenuController

I have a UITableView that displays the data from my plist. Is there any way I could edit/delete the row's data using UIMenuController? It would be fine to use the traditional swipe-the-row in order to edit/delete the row, but I am using…
Jahm
  • 658
  • 1
  • 12
  • 27
0
votes
2 answers

how to disable UIMenuControll (cut,copy,paste,select all,delete) in UIviewController subclass?

i have implemented many methods but paste doesn't hide. i am using Xcode Version 4.5.2 -(BOOL)canPerformAction:(SEL)action withSender:(id)sender { UIMenuController *menuController = [UIMenuController sharedMenuController]; if…
iAhmed
  • 6,556
  • 2
  • 25
  • 31
0
votes
1 answer

UIWebView freezes when text is selected

My app, on very rare occasions, freezes when I select text in a UIWebView. Here's how it happens: Tap and hold to select text Text gets selected Whole app freezes, unresponsive to touch, but I can still see operatings running May freeze for around…
honcheng
  • 2,014
  • 13
  • 14
0
votes
1 answer

iOS - Showing Menu in UITableViewCell

In my application, i've to show a menu controller on tapping a table view cell. Its showing a menu. As well as all the actions are being executed successfully. Good till now. One minor problem I'm facing is that, I'm not able to hide the menu…
Satyam
  • 15,493
  • 31
  • 131
  • 244
0
votes
1 answer

UIMenuController doesn't show in a second UIViewController

I have two UIViewController, one is the main and from this trough a button you can go to the second. In SecondView.m I have the following code: - (IBAction)showpopup:(id)sender { [self becomeFirstResponder]; UIMenuController…
0
votes
1 answer

Deselect word after Define in UITextView

I've got a UIViewController with UITextView in its view. When user selects text, there's Define system menu item that uses UIReferenceLibraryViewController to define the word. The problem is that the word stays selected after the dictionary is…
Rudolf Adamkovič
  • 31,030
  • 13
  • 103
  • 118
0
votes
1 answer

UITableViewCell won't become first responder (Showing UIMenuController on cell gesture)

I have an application with a UITabBar. Every tab is a UINavigationController with several UIViewControllers inside. One of those View Controllers contains a UITableView, and I want to display a floating menu for deleting the long pressed…
momo
  • 3,404
  • 6
  • 37
  • 66
0
votes
1 answer

UIMenuController not showing custom UIMenuItem in subclassed UITextView

I have a subclassed UITextView that I would like to show a custom UIMenuItem when a user pressed and holds in the UITextView. For the life of me, I cannot get my custom item to show. Here is what I am doing in viewDidLoad: UIMenuItem…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
0
votes
1 answer

Is it possible to replace method of all objects using it as implementation of a protocol?

Is it possible to replace method of all objects using it as implementation of a protocol? The method is canPerformAction:(SEL)action withSender:(id)sender: - (BOOL)myCanPerformAction:(SEL)action withSender:(id)sender { return NO; } The initial…
Dmitry
  • 14,306
  • 23
  • 105
  • 189
0
votes
1 answer

UIMenuController not appearing after change of view

I have a UIMenuController which is presented when a UIView is tapped. I have implemented the canPerformAction and canBecomeFirstResponder methods, and it works when the view is first loaded. The app is navigated by a tab view, and if a user is to…
Carl Goldsmith
  • 750
  • 1
  • 5
  • 11
0
votes
1 answer

How to disable copy,paste options in UITextView and enable it again iPhone app?

Am working in UITextView based iPhone app. In one of my screen i having 3 UITextView when the user tap on the screen am showing UIMenuController with custom MenuItems. In this scenario UITextView is in Active means UITextView is becomResponder. So…
Gopinath
  • 5,392
  • 21
  • 64
  • 97
1 2 3
18
19