Basic usage of UISplitViewController

Source: Internet
Author: User

Basic usage of UISplitViewController

In the afternoon, I got a sample code for pover, And I just used UISplitViewController. I haven't used this stuff too much, so I should sort it out and consolidate it.

1. Several Important attributes (in fact, there are only a few)

(1) viewControllers attribute, type NSArray.

Two UINavigationController objects are referenced here. The first is the master menu controller of UISplitViewController, and the second is the detail controller. You must set these two navigation controllers first.

(2) presentsWithGesture attribute, bool type.

This is set to yes. When the screen is portrait, you can call out the menu bar through gestures. The default value is yes.

(3) The third is the proxy property. I have nothing to say about it. Generally, I set the detail control as a proxy.


2. Several required proxy Methods

(1)

-(Void) splitViewController: (UISplitViewController *) svc willHideViewController :( UIViewController *) aViewController withBarButtonItem :( UIBarButtonItem *) barButtonItem forPopoverController :( UIPopoverController *) popoverController

The proxy method is called when the device is converted to a portrait screen and the menu bar is hidden.

AViewController is the controller reference in the menu bar.

BarButtonItem is the navigation bar button on aViewController.

PopoverController indicates that aViewController is displayed in this popover.

(2)

-(Void) splitViewController :( UISplitViewController *) svc popoverController :( UIPopoverController *) pc willPresentViewController :( UIViewController *) aViewController

When the screen is portrait, the interface method is called to call the hidden menu bar.

(3)

-(Void) splitViewController: (UISplitViewController *) svc willShowViewController :( UIViewController *) aViewController invalidatingBarButtonItem :( UIBarButtonItem *) barButtonItem

When the device is rotated to a horizontal screen, this proxy method is called when the menu bar is displayed.


Well, this UISplitViewController should be quite simple to use. Let's do it first ······


Reprinted please indicate the source: Blog: Yan Feng zhicao Jin Author: away

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.