无法解析 androidx 中的符号"底部导航项目视图"



我删除了implementation 'com.android.support:design:28.0.0'并迁移到androidximplementation 'com.google.android.material:material:1.4.0-alpha01'我想知道BottomNavigationItemView的等效代码是什么。

`public void hideOrShowBottomNavigationItem(int id,BottomNavigationView视图,int visibility({

BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);
for (int i = 0; i < menuView.getChildCount(); i++) {
BottomNavigationItemView itemView = (BottomNavigationItemView) menuView.getChildAt(i);
if (itemView.getId() == id) {
itemView.setVisibility(visibility);
}
}
}` i am getting error cannot resolve BottomNavigationItemView

检查项目中正确的导入:

import com.google.android.material.bottomnavigation.BottomNavigationItemView
import com.google.android.material.bottomnavigation.BottomNavigationView

相关内容

  • 没有找到相关文章

最新更新