Nativescript在BottomNavigation上设置selectedIndex在Android上不起作用



我正在尝试以编程方式设置底部导航的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材料底部导航(

看起来它是5.2.15中的一个错误,更新到5.2.17,现在它可以工作了。

最新更新