uimenucontroller

How to get UIMenuController work for a custom view?

I'm trying to get the following code work: UIMenuController * menu = [UIMenuController sharedMenuController]; [menu setTargetRect: CGRectMake(100, 100, 100, 100) inView: self.view]; [menu setMenuVisible: YES animated: YES]; The menu instance is ready but it doesn't show - the width is always zero. Or is there some sample code on this...

How to control placement of paste menu in a UITextView in iPhone SDK

I have a UITextView placed just below a view containing an ad and when the user tries to paste in text the paste menu overlays the ad which is just above the insertion point. I don't want to encourage accidental clicks so I'm looking for a way to make the menu display below the insertion point instead of above it. Or maybe there's a way ...

Hide UIMenuController using UIMenuControllerWillShowMenuNotification

Hi, I have a UITextView(not editable). When user tries to select text I want to hide the Select | Select All menu. Is there a way by which I can hide using the Global notification UIMenuControllerWillShowMenuNotification, or is there any other way by which I can hide and Select | Select All menu? Thanks a lot ...

Implementing iphone's copy/paste controls on a custom view / uiview subclass

I will admit that there is already a question exactly along these lines here on S.O., but it lacks implementation details, a working answer, and I would like to be more specific, so I think a new question is in order. Obviously, let me know if I'm wrong and we can try to restart the thread over there. Basically, I want to copy the text ...

showing custom menu on selection in UIWebView in iphone

I want to show 2 options like "hi" & "bye" when user completes selection on UIWebView. I have added observer to my view controller as follows. But I don't know further implementation. Please guide me. [[UIMenuController sharedMenuController] addObserver:self forKeyPath:UIMenuControllerWillShow...

UIMenuController disappears when the screen is clicked somewhere other than the menu

Hello, I'm working with the UIMenuController and it disappears when the screen is clicked. When I show the menu I need to wait for the user to select an item before the menu fades away but if the click anywhere on the screen (not on the menu bar) the menu will still fade out. Is there any way to prevent this? Does it possibly have so...

UIMenuController not showing up

I'm trying to create a custom UIMenuController and display it in my view. Here's my code: UIMenuController *menuController = [UIMenuController sharedMenuController]; UIMenuItem *listMenuItem = [[UIMenuItem alloc] initWithTitle:@"List" action:@selector(addList:)]; [menuController setMenuItems:[NSArray arrayWithObject:listMenuIte...

makeKeyAndVisible for secondary screen stops UIMenuController from appearing

I present a UIMenuController over a view to display a copy and paste menu popup. This works great, but recently I added external screen functionality to my app. When I present a view and add it to the external screen I call ... [extWindow setScreen:extScreen]; [extWindow addSubview:viewController.view]; [extWindow makeKeyAndVisible...

Unable to add new items to UIMenuController's menuItems

EDIT: I have modified Apple's colored tile example by adding UIMenuController *theMenu = [UIMenuController sharedMenuController]; theMenu.arrowDirection = UIMenuControllerArrowLeft; to applicationDidFinishLaunching and adding a UITextView right next to the reset button. If I double click on a colored tile, the copy paste menu correc...

Dynamic UIMenuItems with @selector and dynamic methods.

Hi, I am trying to use UIMenuController for a dynamical menu (titles and actions come from a server). The problem is that I have to use UIMenuItems initWithTitle:action: where action is a @selector. I can use @selector(dispatch:) but then I am not able to distinguish which of the items the user pressed. - (void)dispatch:(id)sender { NSL...

Problems adding more than one UIMenuItem to UIMenuController

Hello, I'm using the new customization abilities of the UIMenuController to add things other than "Copy" to the menu for cut&paste into a webview. What I do is getting the reference to the shared UIMenuController, setting my NSArray of UIMenuItems into the menuItems, and everything work fine as long as I add a single item. For instance...

How to remove th COPY UIMenuItem in UIMenuController

Hi Guys, I am developing an iPhone application and worked with UIWebViews. I planned to customize the UIMenuItems thats popped up when i highlight strings in UiWebView (Copy, Select All, Cut, etc.). I tried removing those menuItems but i cannot remove the COPY menu item. I need your help guys. Thanks, ZaldzBugz ...

UIMenuController Custom Items.

I have created a UIMenuController and have set it a custom menu item like so: UIMenuController *menuController = [UIMenuController sharedMenuController]; UIMenuItem *item1 = [[UIMenuItem alloc] initWithTitle:@"Do This" action:@selector(item1)]; [menuController setMenuItems:[NSArray arrayWithObject:item1]]; But I wanted that object to ...

Don't dismiss keyboard when presenting popup menu on a custom view

I created my own UIView subclass to present text information to the user. User is able to double tap this view to popup a 'Copy' menu. The problem is that UITextView within the same view controller resigns its first responder status thus dismissing keyboard when popup menu is presented. How do I avoid this? I want my application to behav...

Determine when a UIMenuController is dismissed?

Is there a way to determine when a UIMenuController has been dismissed? I have a (non-editable) text area I'm highlighting when the menu is brought up, and I'd like to un-highlight it when they either select an item (easy) or cancel (not possible?) ...

Customize UIMuenuitem title

Hi, I am using the table to display a list of members and when I click a cell in the table I am creating some custom menu items and showing the menu by customizing the cellview class. Now we have total 6 menu items and some of them are long in length, is there any way I can wrap the menu title so that we have enough space to display all...

Adding a dynamic custom UIMenuItem to Copy & Paste Menu before it shows.

I have successfully been able to add a custom UIMenuItem to the Copy & Paste menu in my iPhone app, and even subclassed UITextView to get rid of the standard menu items. However, what I need to do is to somehow capture the fact that the menu is going to be displayed before it actually happens, and add the word at the insertion point int...

NSNotifcation for UIMenuControllerWillShowMenuNotification

I am trying to listen for UIMenuController Notification in iphone sdk 3.0 . But it seems that my notification can never get called. Here is my code: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuControllerWillShow:) name:UIMenuControllerWillShowMenuNotification object:nil]; and my method - (void)m...