-
Notifications
You must be signed in to change notification settings - Fork 421
CATabBarController
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.
CAViewController,CATabBarDelegate,CAPageViewDelegate,CAScrollViewDelgate
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 |
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 |
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;
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, tabBar’s position |
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 |
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. |