Popover view and Modal view

Source: Internet
Author: User
Popover and Modal view (Modal view)Popover view: click a place outside the view, and the popover view disappears.


Popover view display:

PopoverViewController *controller =         [[self storyboard] instantiateViewControllerWithIdentifier:@"PopoverView"];        [controller setDelegate:self];        UIPopoverController *popoverController =         [[UIPopoverController alloc] initWithContentViewController:controller];         [popoverController setPopoverContentSize:CGSizeMake(320.0, 320.0)];        [popoverController presentPopoverFromBarButtonItem:[self modalButton]                               permittedArrowDirections:UIPopoverArrowDirectionUp                                               animated:YES];

 

Modal view: Generally, You need to click a button on the view to make the Modal view disappear.


Modal view display:

ModalViewController *modalView = [[self storyboard] instantiateViewControllerWithIdentifier:@"ModalView"];    ;[modalView setModalTransitionStyle:UIModalTransitionStyleCoverVertical];            [modalView setModalPresentationStyle:UIModalPresentationFormSheet];[self presentModalViewController:modalView animated:YES];

 

When to use Popover?The suggestion in the Apple user interface manual is: 1 to provide additional information list related to the selected control 2 to display the list of left-side panels on the horizontal screen in the split view of the vertical screen. 3 is used to display the list of options to be displayed in the Action sheet. When to use Modal view?The suggestion in the Apple user interface manual is: 1 to get real-time information (the program needs the corresponding information to continue) 2. provide some key information during the running process. 3. Determine the program running process (depending on the user's choice and execute different processes). The default Modal view of the system is too large, how can I adjust the size (size) of the Modal view?
[Self presentModalViewController: modalView animated: YES]; // specifies the size of modalView. view. superview. frame = CGRectMake (0, 0,400,400); // adjust the position // modalView. view. superview. center = self. view. center; modalView. view. superview. center = CGPointMake (512,374 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.