uimenucontroller

How can I detect that a user has tapped a formatting button in a UIMenuController?

浪子不回头ぞ 提交于 2019-12-25 01:58:01
问题 My app allows users to format text in a UITextView by using some custom formatting buttons I've created. Now I want to enable the allowsEditingTextAttributes property of the text view so that users can copy and paste formatted text between text views. This enables the bold/italic/underline buttons in the standard UIMenuController for the text view. This is fine, but when users change the formatting through this menu, I need to call my custom method that updates the state of my custom

UIMenu popovers in CollectionView

♀尐吖头ヾ 提交于 2019-12-22 15:23:06
问题 This is how i set up the popovers UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"Delete Patient" action:@selector(customAction:)]; [[UIMenuController sharedMenuController] setMenuItems:@[menuItem]]; and then add the require methods - (BOOL)canBecomeFirstResponder { return YES; } - (BOOL)canPerformAction:(SEL)action withSender:(id)sender { NSLog(@"canPerformAction"); // The selector(s) should match your UIMenuItem selector if (action == @selector(customAction:)) { return YES; }

How to remove Copy,Select All,Define menuItem from UIMenuController

冷暖自知 提交于 2019-12-21 20:36:29
问题 As my this question Display i want to display pop up when user select the text. and in that pop up detail about that word will be displayed. But i didn't get any satisfactory answer so i have change my logic. Now i want to display one item like Pop-Up in my UIMenuController and when user click that option than pop-up will displayed. I have achieved this using this code, UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"Pop-Up" action:@selector(displayPopUp:)]; [[UIMenuController

UIMenuController hides the keyboard

心不动则不痛 提交于 2019-12-21 13:22:29
问题 I currently have an application which is for chatting. I used a UItextField for input box and bubbles for display messages, some thing like the system SMS. I want to enable copy paste on the message bubbles (labels). The problem is, when I want to show the UIMenuController, the label which i need to copy from need to become first responder. If the keyboard is currently displayed, when the label become first responder, the textfield will lost focus, thus the keyboard will be hide automatically

UIMenuController hides the keyboard

大憨熊 提交于 2019-12-21 13:21:10
问题 I currently have an application which is for chatting. I used a UItextField for input box and bubbles for display messages, some thing like the system SMS. I want to enable copy paste on the message bubbles (labels). The problem is, when I want to show the UIMenuController, the label which i need to copy from need to become first responder. If the keyboard is currently displayed, when the label become first responder, the textfield will lost focus, thus the keyboard will be hide automatically

How to remove th COPY UIMenuItem in UIMenuController

孤人 提交于 2019-12-21 06:49:03
问题 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 回答1: You're going to have to do some hijacking. I don't even know if it is possible. It looks like it probably responds to a gesture event called UILongPressGestureRecognizer. You need to find

Trouble Displaying UIMenuController When Cell Tapped In UITableView

喜你入骨 提交于 2019-12-21 06:00:11
问题 I'm trying to display a custom UIMenuController when a User long presses on a cell in a grouped UITableView. However, I can't seem to get the UIMenuController to display after successfully detecting the long press. Any help is greatly appreciated. MyViewController.h @interface MyViewController : UIViewController <UITableViewDelegate,UITableViewDataSource> UITableView *table; @property (nonatomic, retain) IBOutlet UITableView *table; @end In the cellForRowAtIndexPath I attach my Long Press

How to add custom menu item to UITextView menu, which is a link to the Wikipedia page of the selected word?

有些话、适合烂在心里 提交于 2019-12-20 19:36:54
问题 I am new to Xcode, I am using version 4.6.3 - Macbook too old for the new version. I looked around the internet and Stack Overflow and cannot find what I want or I cannot get snippets to work. I would like to add a menu item to the menu items that appear when longpressing a word in a UITextView. I want it to say "Wiki" and when this is pressed, it will link to the wikipedia page of the word that is selected. It may be through Safari or should I do this within the app with a webview? I found:

Dynamic UIMenuItems with @selector and dynamic methods

冷暖自知 提交于 2019-12-18 11:56:46
问题 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 { NSLog(@"%@", sender); } says it is a UIMenuController and It don't have a method which would tell which menu item was pressed. I can't just write 100 methods to

Perform copy/cut from UIResponderStandardEditActions

让人想犯罪 __ 提交于 2019-12-18 07:16:10
问题 These are standart actions for UIMenuController declared http://developer.apple.com/library/ios/#documentation/uikit/reference/UIResponderStandardEditActions_Protocol/UIResponderStandardEditActions.html How can I perform these methods manually, like from another UIMenuItem or whatever? I can't find the right selector:( [self cut:sender]; [UIResponder cut:sender]; [[UIMenuController sharedMenuController] cut:sender]; (void) cut: (id) sender {[super cut:sender];} So far non of these don't work,