我正在尝试使用android底部导航视图,并且默认布局在图标下方显示了我想要的图标,并且一行中显示了文字:
我创建了这个布局,我想用我的替换默认布局:
bottom_navigation_item:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/bottom_navigation_item_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_settings_black_24dp"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/bottom_navigation_item_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:lines="1"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="@+id/bottom_navigation_item_image"
app:layout_constraintStart_toEndOf="@+id/bottom_navigation_item_image"
app:layout_constraintTop_toTopOf="@+id/bottom_navigation_item_image"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
我该如何更换? 我不想只使用“ com.google.android.material.bottomnavigation.BottomNavigationView”的第三方库