iOS learning-How to switch pages

Source: Internet
Author: User

1 modal (model)

Go to page B (write the following code on page a)

(1) b page name *vc=[[b page name alloc] init];

vc.modaltransitionstyle=uimodaltransitionstylecoververtical;

or (2) b page name *vc=[[b page name alloc] initwithnibname:@ "b page name" Bundle:nil];

[Self Presentmodalviewcontroller:zhuchu animated:yes];//display modal screen

Return to page A (write the following code on page b)

[Self dismissmodalviewcontrolleranimated:yes];//off modal screen

2 Switchviewcontroller (simultaneous start of two screens)

Self.view Insertsubview: (New page loaded) Atindex:n;

Tip: n means loading to that level

Used in a page sometimes to show or hide a view that obscures

3 Uitabbarcontroller (Implement parallel screen jump)

Self.tabBarController.viewControllers = @[navfrist, navsecond,navthird,navfourth,navfifth];

Self.window.rootViewController = Self.tabbarcontroller;

[Self.window addsubview:self.tabbarcontroller.view];//Add a view of the root controller to the main application window

4 Uinavigationcontroller (Multi-layer screen jump), in the navigation controller, loading a hierarchical interface

Go to page B (write the following code on page a)

b page name *addsymbol=[[b page name alloc] initwithnibname:@ "b page name" Bundle:nil];

[Self.navigationcontroller Pushviewcontroller:addsymbol Animated:yes];

Return to page A (write the following code on page b)

[Self.navigationcontroller Popviewcontrolleranimated:yes]; Return to original view after Popup

iOS learning-How to switch pages

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.