uimenucontroller

Is it possible to customize the color of a UIMenuController?

荒凉一梦 提交于 2019-11-29 07:56:14
The default background color is black. How can I change the color, similar to tintColor for navigation bars? I'm pretty sure this is not possible. You may be able to work something out if you subclass it. EDIT: I took a look at the UIMenuController.h file and there don't seem to be any obvious ways to change the color. It is a subclass of NSObject if that helps you. Also, if you take a look at how people subclass UITabBarController to change it's color you may be able to work out a similar solution. A possible solution to change the text color consists in using the appearance proxy of the

UIMenuController sharedMenuController - custom menuitem for uicollectionview do not show in ios 7

亡梦爱人 提交于 2019-11-29 07:09:55
I'm using a UIMenuItem to perform a custom action in UICollectionView cell long press. this worked perfectly with iOS 6, but now I am converting my application to iOS 7 and Xcode 5 and it don't work. The custom item do not shown. UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"Unfavorite" action:@selector(unFavorite:)]; [[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObject:menuItem]]; [UIMenuController sharedMenuController].menuVisible = YES; - (BOOL)collectionView:(UICollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:

UIMenuController method setTargetRect:inView: not working in UITableView

只愿长相守 提交于 2019-11-29 01:53:37
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 rectangle (targetRect) is usually the bounding rectangle of a selection. UIMenuController positions the

IOS UIMenuController UIMenuItem, how to determine item selected with generic selector method

霸气de小男生 提交于 2019-11-28 10:16:49
With the following setup .... MyUIMenuItem *someAction = [[MyUIMenuItem alloc]initWithTitle : @"Something" action : @selector(menuItemSelected:)]; MyUIMenuItem *someAction2 = [[MyUIMenuItem alloc]initWithTitle : @"Something2" action : @selector(menuItemSelected:)]; .... - (IBAction) menuItemSelected : (id) sender { UIMenuController *mmi = (UIMenuController*) sender; } How to figure out which menu item was selected. And don't say that you need to have two methods... Thanks in advance. sobri Okay, I've solved this one. The solution isn't pretty, and the better option is "Apple fixes the problem"

showing custom menu on selection in UIWebView in iphone

╄→尐↘猪︶ㄣ 提交于 2019-11-28 03:21:15
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. [[UIMenuController sharedMenuController] addObserver:self forKeyPath:UIMenuControllerWillShowMenuNotification options:nil context:nil ]; Jacques Sagar, Your question is a couple of months old, but I finally figured this one out, so I figured I'd answer it in case it helps out someone else. I added the following code to the viewDidAppear: method of the view controller that contains the webview. - (void

Is it possible to customize the color of a UIMenuController?

扶醉桌前 提交于 2019-11-28 01:37:14
问题 The default background color is black. How can I change the color, similar to tintColor for navigation bars? 回答1: I'm pretty sure this is not possible. You may be able to work something out if you subclass it. EDIT: I took a look at the UIMenuController.h file and there don't seem to be any obvious ways to change the color. It is a subclass of NSObject if that helps you. Also, if you take a look at how people subclass UITabBarController to change it's color you may be able to work out a

UIMenuController sharedMenuController - custom menuitem for uicollectionview do not show in ios 7

喜夏-厌秋 提交于 2019-11-28 00:58:46
问题 I'm using a UIMenuItem to perform a custom action in UICollectionView cell long press. this worked perfectly with iOS 6, but now I am converting my application to iOS 7 and Xcode 5 and it don't work. The custom item do not shown. UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"Unfavorite" action:@selector(unFavorite:)]; [[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObject:menuItem]]; [UIMenuController sharedMenuController].menuVisible = YES; - (BOOL

How do you REALLY remove Copy from UIMenuController

我只是一个虾纸丫 提交于 2019-11-27 18:34:38
There apparently used to be an easy way to prevent the "More..." label from appearing in UIMenuController when you added more than one custom menu item. You just had to remove all of the system menu items. There was even a workaround here for still having copy work. You just had to implement a custom copy command using a different selector and then override canPerformAction:withSender: to not show the system copy: -(BOOL)canPerformAction:(SEL)action withSender:(id)sender { if (action == @selector(copy:)) return NO; else // logic to show or hide other things } Unfortunately this method no

UIMenuController Custom Items

房东的猫 提交于 2019-11-27 17:54:49
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 be the only one to appear so I added this code: - (BOOL)canPerformAction: (SEL)action withSender: (id)sender { BOOL answer = NO; if (action == @selector(item1)) answer = YES; return answer; } The problem is it still shows other## Heading ## items, such as "Select"

UIMenuController not showing up

拈花ヽ惹草 提交于 2019-11-27 11:18:00
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:listMenuItem]]; [menuController setTargetRect:CGRectMake(50.0, 50.0, 0, 0) inView:self.view]; [menuController setMenuVisible:YES animated:YES]; [listMenuItem release]; There are no errors or exceptions, but the menu controller just doesn't show up. OZ Apps You need to do three