Creating iPhone Pop-up Menu Similar to Mail App Menu
Check out the UICatalog example on Apple's website. The "Alerts" section has examples of how to use UIActionSheet to accomplish what you're trying to do.
Name of menu in mail app
It's UIActionSheet.
How do I create an iOS7 style popup menu in Xcode?
You are after the UIActionSheet. This is a control found within all versions of iOS, but has recently been re-skined for iOS7.
Update: UIActionSheet was deprecated in iOS 8, and instead you should use UIAlertController with the style of actionSheet
How to create pop up app menus
Take a look at the Apple library:
SplitViewController
And furthermore take a look at Ray Wenderlichs Tutorial:
UISplitViewController
I think this should be a good way for you to learn this.
Regards,
Noah
How to code an iPhone style popup menu in CN1?
See this sample:
Form hi = new Form("Pop");
Button pop = new Button("Pop");
pop.addActionListener(e -> {
Dialog dlg = new Dialog();
// makes the dialog transparent
dlg.setDialogUIID("Container");
dlg.setLayout(BoxLayout.y());
Command optionACmd = new Command("Option A");
Command optionBCmd = new Command("Option B");
Command optionCCmd = new Command("Option C");
Command cancelCmd = new Command("Cancel");
dlg.add(
ComponentGroup.enclose(
new Button(optionACmd),
new Button(optionBCmd),
new Button(optionCCmd)
)).
add(ComponentGroup.enclose(new Button(cancelCmd)));
Command result = dlg.showStretched(BorderLayout.SOUTH, true);
ToastBar.showMessage("Command " + result.getCommandName(), FontImage.MATERIAL_INFO);
});
hi.add(pop);
hi.show();
Which results in this:
How to implement a pop-up dialog box in iOS?
Yup, a UIAlertView
is probably what you're looking for. Here's an example:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No network connection"
message:@"You must be connected to the internet to use this app."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
If you want to do something more fancy, say display a custom UI in your UIAlertView
, you can subclass UIAlertView
and put in custom UI components in the init
method. If you want to respond to a button press after a UIAlertView
appears, you can set the delegate
above and implement the - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
method.
You might also want to look at the UIActionSheet
.
How to create popover in iPhone app?
You could make a UIView
with some custom artwork and display it with an animation on top of your view as a "popover" with some buttons like so:
UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(25, 25, 100, 50)]; //<- change to where you want it to show.
//Set the customView properties
customView.alpha = 0.0;
customView.layer.cornerRadius = 5;
customView.layer.borderWidth = 1.5f;
customView.layer.masksToBounds = YES;
//Add the customView to the current view
[self.view addSubview:customView];
//Display the customView with animation
[UIView animateWithDuration:0.4 animations:^{
[customView setAlpha:1.0];
} completion:^(BOOL finished) {}];
Don't forget to #import <QuartzCore/QuartzCore.h>
, if you want to use the customView.layer
.
Creating a pop out menu without a nav bar button
You can set a UIButton to call a selector like this:
[button addTarget:self
action:@selector(revealToggle:)
forControlEvents:UIControlEventTouchUpInside];
Related Topics
Why Can't I Force Landscape Orientation When Use Uinavigationcontroller
Googlemaps Basic iOS Demo App Crash - Unrecognized Selector Sent to Instance
How to Know That If the Only Visible Area of a .Png Is Touched in Xcode
How to Create a String with Format
iOS Scrollview Needs Constraint for Y Position or Height
Dial Ussd Code from iPhone Programmatically
How to Post Nested JSON by Swiftyjson and Alamofire
How to Handle iPhone Screen Sizes/Resolution for Background Images
How to Display the Default iOS 6 Share Action Sheet with Available Share Options
Ask for User Permission to Receive Uilocalnotifications in iOS 8
Xcode 8.3/Xcode 9.0 Refresh Provisioning Profile Devices
How to Disable the Network in iOS Simulator
Swift Unrecognized Selector Sent to Instance Error
Is There a Swiftui Equivalent for Viewwilldisappear(_:) or Detect When a View Is About to Be Removed