uimenucontroller

UIMenuController in iOS 13 beta shows with transparent background instead of black background

我与影子孤独终老i 提交于 2020-07-22 06:29:04
问题 I am using UIMenuController to display custom options. It was working fine with a black background and white text on UIMenuItems till iOS 12. After upgrading to iOS 13 beta 8 with Xcode 11 beta 7, the background changed to transparent. Is there anyone else facing this problem? 来源: https://stackoverflow.com/questions/57699513/uimenucontroller-in-ios-13-beta-shows-with-transparent-background-instead-of-bla

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

好久不见. 提交于 2020-01-14 06:21:04
问题 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 the selected text in my newly created selector method. If I use the copy command on selected text first, then I can get that previously copied text from the pasteboard, but a command like [myWebView copy:sender]; called from my new selector does

Why is the sender of an UIMenuItem action always nil?

一世执手 提交于 2020-01-04 14:20:39
问题 I've added an UIMenuItem instance to UIMenuController . When I tap in a text field twice, then I get that text editing menu with Copy, Cut, Paste, Lookup in Wikipedia. This is my action method: - (void)lookupInWikipedia:(id)sender { NSLog(%@"lookupInWikipedia: sender=%@", sender); } I get the NSLog when I select the "Lookup in Wikipedia" menu item. But sender is always nil. Not even the -canPerformAction:withSender: method receives anything other than nil for sender. - (BOOL)canPerformAction:

How to disable Copy & Define UIMenuItems of UIMenuController in UITextfield

痞子三分冷 提交于 2020-01-01 19:14:23
问题 I am implementing custom UIMenuController and trying to figure out. How can I legally disable "Copy" and "Define" UIMenuItems of UIMenuController in UITextfield ? Textfield is not editable. I tried to disable "Copy" using: -(BOOL)canPerformAction:(SEL)action withSender:(id)sender { if (action == @selector(copy:)) { return NO; } return [super canPerformAction:action withSender:sender]; } - (IBAction)tapTextViewGesture:(id)sender { UIMenuItem *myItem1 = [[UIMenuItem alloc] initWithTitle:@

Display UIMenuController in editingDidBegin of a UITextField

非 Y 不嫁゛ 提交于 2020-01-01 03:47:06
问题 I simply want to display the UIMenuController right after a textfield has become active. What i'm doing right now is: - (IBAction)textFieldeditingDidBegin:(UITextField *)sender { // textfield menu item UIMenuController *menu = [UIMenuController sharedMenuController]; [menu setTargetRect:sender.frame inView:self.view]; [menu setMenuVisible:YES animated:YES]; } The method gets called but it just will not display the menu... If i do a touch+hold gesture on the textfield it comes up regularly. I

Problems showing UIMenuController one after another

♀尐吖头ヾ 提交于 2020-01-01 02:34:09
问题 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 I see [COPY|FOOBAR]. Instead if I try adding more than a single item, what happen is that I see [COPY|MORE], if I press into MORE than finally the other items will

iPhone6 (no display zoom mode) UIMenuController truncated

只愿长相守 提交于 2019-12-31 00:34:09
问题 I have a problem with the UIMenuController on my iPhone 6 when I use the standard display mode and device is in landscape mode. On iPhone 6 Plus the problem is in both modes. Maybe it's depends on screen resolution. In that case, the UIMenuController will be truncated left and/or right. It seems that the UIMenuController can have maximum bounds as if the phone is in portrait mode. See UIMenuController truncated (iPhone6 landscape schematic): http://imageshack.com/a/img631/8470/ozlaGe.jpg

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

荒凉一梦 提交于 2019-12-30 01:20:11
问题 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 in a UILabel to the pasteboard when a user holds down on the label. Not hard to do, honestly. However, I think the best way to provide visual feedback is to

UIMenuController method setTargetRect:inView: not working in UITableView

落花浮王杯 提交于 2019-12-29 05:21:08
问题 I am displaying custom UIMenuController in my tableview like this but issue is that it is displaying in the center I want to display it on top of label which is orange colored. For displaying on top of label I did this [menu setTargetRect:CGRectMake(10, 10, 0, 0) inView:self.lbl]; below is the entire code. But if I am displaying the UIMenuController without UITableView setTargetRect works fine. Why setTargetRect is not working with UITableView ? setTargetRect Doc says: (a) This target

iOS - NotificationCenter addObserver “UIMenuControllerWillHideMenu”

你。 提交于 2019-12-25 11:16:09
问题 I have added notification observer for UIMenuControllerWillHideMenu but it does not call selector added/associated with notification center. UIMenuControllerWillHideMenu is notification center identifier for UIMenuController and should be called when UIMenuController will hide. But somehow it's not working. Here is code I've tried (Swift 3.x): private func addMenuObserverNotification(){ NotificationCenter.default.addObserver(self, selector: #selector(self.menuControllerWillHideMenu), name: