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