【发布时间】:2021-04-12 22:05:17
【问题描述】:
我正在尝试以编程方式设置底部导航的selectedIndex。
它适用于 iOS - 但在 Android 上,什么都不会发生。
const rootView = Application.getRootView();
const bottomBar = rootView.getViewById("bottomNavigation");
console.log('bottomBar', bottomBar.selectedIndex);
bottomBar.selectedIndex = 2;
console.log('bottomBar-changed', bottomBar.selectedIndex);
console.log 表明 selectedIndex 确实发生了变化。
我尝试rootView.requestLayout() 刷新视图,但没有帮助。
有什么想法吗?
Nativescript 8.x,来自插件的 BottomBar (@nativescript-community/ui-material-bottom-navigation)
【问题讨论】:
标签: android nativescript