以下是执行底部导航的XML代码:
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_navigation_height"
android:layout_alignParentBottom="true"
android:background="@android:color/white"
app:elevation="3dp"
app:itemBackground="@color/colorWhite"
app:itemIconTint="@drawable/bottom_nav_selector"
app:itemTextColor="@drawable/bottom_nav_text_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/bottom_menu" />
这是删除shift模式的Java代码:
BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottom_navigation);
BottomNavigationViewHelper.removeShiftMode(bottomNavigationView);
我想添加左右幻灯片。这里我在底部导航菜单上添加了一个Listener,这是我的代码。
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {