android.view.InflateException:二进制XML文件行#29:Binary XML文件行



所以我搜索了很多来源来解决这个问题。但是我不知道怎么解决这个问题。

Caused by: android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class com.google.android.material.bottomnavigation.BottomNavigationView

这是我的代码

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
tools:ignore="MissingConstraints" />
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigationView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:itemBackground="@color/colorPrimary"
app:itemIconTint="@android:color/white"
app:itemTextColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/container"
app:menu="@menu/navigation"
/>

帮我解决这个问题。提前感谢

com.google.android.material.bottomnavigation.BottomNavigationView中存在约束,但这应该在constraintLayout中。这会是问题吗?你还必须检查你的抽屉。膨胀类com.google.android.material.bottomnavigation.BottomNavigationView 时出错

如果这些建议不能解决你的问题,你能把你的完整布局放在这里吗。

最新更新