如何使底部的导航栏出现在选定的活动中而不出现在其他活动中? 我应该添加哪些行以使其实现
答案 0 :(得分:0)
底部导航栏也是某些布局文件中的视图,您可以这样做:
setContentView(R.layout.activity_main);
BottomNavigationView bottomNavigationView = (BottomNavigationView)
findViewById(R.id.navigation);
bottomNavigationView.setVisibility(View.INVISIBLE); //In activity you want to hide it
bottomNavigationView.setVisibility(View.VISIBLE); //In activity you want to show it