【问题标题】:Nativescript setting selectedIndex on BottomNavigation not working on Android底部导航上的 Nativescript 设置 selectedIndex 在 Android 上不起作用
【发布时间】: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


    【解决方案1】:

    似乎这是 5.2.15 中的错误 - 已更新到 5.2.17,现在可以正常工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多