UIPopoverController for iPhone application development

Source: Internet
Author: User

IPhoneIn application developmentUIPopoverControllerIs the content to be introduced in this article,UIPopoverControllerPay-as-you-go is only available on ipad. Not much content, mainly implemented by codeUIPopoverControllerTo see the details.

The Code is as follows:

 
 
  1. -(Void) viewDidLoad
  2. {
  3. [Super viewDidLoad];
  4. // List
  5. PopTableController * table = [[PopTableController alloc] init];
  6. // Set the display area size
  7. Table. contentSizeForViewInPopover = CGSizeMake (200,300 );
  8. // Instantiate UIPopoverController
  9. PopoverController = [[UIPopoverController alloc] initWithContentViewController: table];
  10. // Use the click button
  11. List = [[[UIBarButtonItem alloc] initWithTitle: @ "list" style: UIBarButtonItemStyleBordered target: self action: @ selector (list :)] autorelease];
  12. // Add the button to the toolbar
  13. [Toolbar setItems: [NSArray arrayWithObject: list];
  14. }
  15. // Button event
  16. -(Void) list :( id) sender
  17. {
  18. // Presentpoverfrombarbuttonitem: The list header points to the list button.
  19. [PopoverController presentpoverfrombarbuttonitem: list permittedArrowDirections ctions: UIPopoverArrowDirectionAny animated: YES];
  20. }
  21. // Hide
  22. -(Void) missView
  23. {
  24. // Hide the view
  25. [PopoverController dismissPopoverAnimated: YES];
  26. }

Summary:IPhoneApplication DevelopmentUIPopoverControllerI hope this article will be helpful to you!

Related Article

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.