iOS about switching between uiviewcontroller

Source: Internet
Author: User

Two ways to switch Uiviewcontroller 1.NavigationController

Method one right into

1 secondviewcontroller* svc=[[Secondviewcontroller alloc]init]; 2 [Self.navigationcontroller PUSHVIEWCONTROLLER:FVC Animated:yes];


Return to the previous

[Self.navigationcontroller Popviewcontrolleranimated:yes];



Another way to cut through the bottom

secondviewcontroller* svc=[[Secondviewcontroller alloc]init];[ Self.navigationcontroller presentmodalviewcontroller:svc Animated:yes];


Back to previous Uiviewcontroller

[Self.navigationcontroller Dismissmodalviewcontrolleranimated:yes];


2. If there is no navigation bar Navigationcontroller, you can also switch

secondviewcontroller* svc=[[Secondviewcontroller alloc]init];[ Self presentmodalviewcontroller:svc animated:yes];


Back to previous Uiviewcontroller

[Self dismissmodalviewcontrolleranimated:yes];

It can be set up in four modes of animation:

    // Bottom-up default animated mode   // gradient   // flip                     Turn Half page        // bottom up default animation mode  

Third, is Uitabbarcontrller it is also inherited from the Uiviewcontroller, mainly to do with the parallel logic features of the viewcontroller between the switch.

The Uitabbarcontrller object has an attribute SelectedIndex, which sets the Viewcontroller that is displayed by default at the beginning.

Triggering a toggle when Tabbaritem is clicked will callback a method in Uitabbarcontrollerdelegate

-(void



iOS about switching between uiviewcontroller

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.