Simple use of Uitabbarcontroller

Source: Internet
Author: User

Precautions: Special height, uitabbar height is 49,uinavigationbar height is 44

The internal structure of the Uitabbar

The red view on the right is overlaid on the blue view on the left, and finally the figure 2.

Figure 1:

Figure 2:

1 Steps to use Uitabbarcontroller

Initialize the Uitabbarcontroller settings UIWindow Rootviewcontroller to Uitabbarcontroller depending on the situation, Add the number of sub-controllers 2 Uitabbarcontroller by the Addchildviewcontroller method 2.1 Uitabbarcontroller Add a controller by adding a single sub-controller in 2 ways

-(void) Addchildviewcontroller: (Uiviewcontroller *) Childcontroller;

Set up a sub-controller array

@property (nonatomic,copy) Nsarray *viewcontrollers;

3 Uitabbar

If the Uitabbarcontroller has n sub-controllers, then there will be N Uitabbarbutton as child controls inside Uitabbar if Uitabbarcontroller has 4 sub-controllers, Then the structure of the Uitabbar is roughly as shown in the 4 Uitabbarbutton 5 app Mainstream UI framework structure 6UITabBar after the program starts if it is VC1 shown on Figure 1, When you click the Uitabbar inside the button to switch to the VC2 VC1 will move to the side (note that the VC2 is not directly covered to VC1 above, if the direct coverage performance will be poor), and then put the VC2 on Figure 1, similarly, if you click the Uitabbar inside the button to switch to VC3, This time the VC2 will be moved to the side, and then the VC3 display to Figure 1, the entire switchover process VC1,VC2,VC3 will not be destroyed (unless a memory warning occurs, will not destroy the VC not shown). Figure 1 Figure 2 7 height of the controller in iOS6 = height of the entire screen-height of the status bar (-uitabbar) height of the controller in iOS7 = height of the entire screen

Simple use of Uitabbarcontroller

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.