mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
18 lines
605 B
TypeScript
18 lines
605 B
TypeScript
import tabViewModule = require("ui/tab-view");
|
|
|
|
export function getNativeTabCount(tabView: tabViewModule.TabView): number {
|
|
if (!tabView.ios.viewControllers) {
|
|
return 0;
|
|
}
|
|
|
|
return tabView.ios.viewControllers.count;
|
|
}
|
|
|
|
export function selectNativeTab(tabView: tabViewModule.TabView, index: number): void {
|
|
tabView.ios.selectedIndex = index;
|
|
tabView.ios.delegate.tabBarControllerDidSelectViewController(tabView.ios, tabView.ios.selectedViewController);
|
|
}
|
|
|
|
export function getNativeSelectedIndex(tabView: tabViewModule.TabView): number {
|
|
return tabView.ios.selectedIndex;
|
|
} |