1

I'd like to create a popup menu, from my tab bar. I've seen them, but I'm not sure what they called ?

Kind of like a speak bubble.

I think copy / paste is the sort of thing I mean.

Jules
  • 7,568
  • 14
  • 102
  • 186

3 Answers3

3

You are searching for the UIMenuController.

This question might help you.

Community
  • 1
  • 1
Björn Marschollek
  • 9,899
  • 9
  • 40
  • 66
1

That could be the UIActionSheet. You might want to give it a try.

//Your delegate for pressed buttons.
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
        //Your Action for pressed button.
    [actionSheet release];
}

//Declare a method to show your sheet
-(void)showActionSheet
{
    UIActionSheet *menu = [[UIActionSheet alloc] 
                           initWithTitle: @"Action Sheet Title" 
                           delegate:self
                           cancelButtonTitle:@"Cancel"
                           destructiveButtonTitle:@"Delete"
                           otherButtonTitles:@"Other Button1", @"Other Button2", nil];
    [menu showInView:self.view];
}

But you said "bubble", so that could also be the UIAlertView.

Try this:

-(void)showAlertView
{
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert!" 
                                                         message:@"This is the message that pops up in the bubble." 
                                                        delegate:self 
                                               cancelButtonTitle:@"OK" 
                                               otherButtonTitles:nil];
        [alert show];
        [alert release];
}

Bernardo Oliveira
  • 818
  • 1
  • 14
  • 30
0

On the iPad, you'd want UIPopoverController, but I think that on the iPhone the same sort of interactions are meant to be performed by a separate, full screen controller or by a UIActionSheet. There's no speech bubble on the iPhone such that I'm aware.

Tommy
  • 99,986
  • 12
  • 185
  • 204
  • I think he means the little menu that comes up when you select or highlight text, UIPopoverController and UIActionSheet do different things. – fearmint Nov 10 '10 at 13:57
  • Though they do different things, Apple appear to endorse the use of a UIActionSheet as the normal way to select options, appearing within a UIPopoverController on the iPad and as a normal action sheet on the iPhone. Hence the addition of showFromBarButtonItem:animated: to UIActionSheet. – Tommy Nov 10 '10 at 14:06