Skip to content
9miao edited this page Sep 29, 2014 · 2 revisions

CATabBarController

Class Description

As a derived class of CAViewController and a special viewController, CATabBarController is responsible for coordinating multi viewControllers inter-work and is a special encapsulation to viewController. In general, TabBarController is very efficient in condition that programs have parallel interface using demand (here the parallel interface means some functionality interface in program is at the same level), and all these functionality interface are able to switch from each other.

Base Class

CAViewController,CATabBarDelegate,CAPageViewDelegate,CAScrollViewDelgate

Attribute

Access modifier

Attribute name

Description

protected

ScrollEnabled

 

start scroll switch or not

protected

TabBarAnimated

play page turning animation or not

 

protected

TabBarHidden

hide tabBar or not

 

protected

TabBar

tabBar that is internal created by tabBarController

protected

TabBarVerticalAlignment

 

tabBar’s vertical position

Method

Access modifier

Method name

Description

public

initWithViewControllers

build CATabBarController

 

public

showSelectedViewController

current selected viewController

public

getSelectedViewController

obtain current selected viewController

public

showSelectedViewControllerAtIndex

display current selected viewController via index value

public

getSelectedViewControllerAtIndex

obtain index value of viewController of current displayed view.

protected

 

updateItem

update tabBarItem

Attribute Description

ScrollEnabled
Type:bool
Descripiton: set scroll by gesture or not, tabBarController page, is/set{}.

TabBarAnimated
Type:bool
Descripiton: read-only property, obtain tabBar’s condition that it’s set switch animation or not.

TabBarHidden
Type:bool
Descripiton: read-only property, obtain tabBar is hiden or not.

TabBar
Type:CATabBar*
Descripiton: read-only property, it’s used to obtain CATabBar of current view controller CATabBarController, when we build tabBarController, each tabBarController will auto build a tabBar, and you can obtain it via getTabBar method.

TabBarVerticalAlignment
Type:CABarVerticalAlignment
Descripiton: read-only property and enumeration type, obtain tabBar position of tabBarController, it’s at the bottom of screen by default.

typedef enum
{
CABarVerticalAlignmentTop = 0,
CABarVerticalAlignmentBottom
}CABarVerticalAlignment;

Method Description

bool initWithViewControllers(const std: : vector<CAViewController>& viewControllers,CABarVerticalAlignment var = CABarVerticalAlignmentBottom)*
Return value:bool
Parameter:

Type

Parameter name

Description

vector<CAViewController*>

viewControllers

view controller array

CABarVerticalAlignment

var

optional parameters, tabBars position

Descripiton: Introduce a group viewController to build CATabBarController which separately manage tabBar subitem. If system does not transfer var parameter, then CATabBarController’s position is at the bottom of screen by default.

bool showSelectedViewController(CAViewController viewController, bool animated)*
Return value:bool
Parameter:

Type

Parameter name

Description

CAViewController*

viewControllers

current view controller

bool

animated

play switch animation or not

CAViewController getSelectedViewController()*
Return value:CAViewController*
Descripiton: obtain current selected viewController

bool showSelectedViewControllerAtIndex(unsigned int index, bool animated)
Return value:bool
Parameter:

Type

Parameter name

Description

unsigned int

index

index value of view controller

bool

animated

play switch animation or not

Descripiton: set current displayed view’s view controller via transferred index value and set play switch animation or not.

unsigned int getSelectedViewControllerAtIndex()
Return value:unsigned int
Descripiton: obtain index value of current selected viewController

void updateItem(CAViewController viewController)*
Return value:void
Parameter:

Type

Parameter name

Description

CAViewController*

viewController

view controller that needs to be updated.

Clone this wiki locally