gpt4 book ai didi

android - 膨胀类 android.support.design.widget.BottomNavigationView 时出错 & 膨胀类 android.support.design.widget.BottomNavigationView 时出错

转载 作者:行者123 更新时间:2023-12-04 01:38:34 26 4
gpt4 key购买 nike

Caused by: android.view.InflateException: Binary XML file line #19: Binary XML file line #19: Error inflating class android.support.design.widget.BottomNavigationView
Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class android.support.design.widget.BottomNavigationView

渐变源

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0-alpha01'
implementation 'androidx.cardview:cardview:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

布局xml源

 <android.support.design.widget.BottomNavigationView
android:id="@+id/navigationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="parent"
app:menu="@menu/menu_bottomnavigationview">
</android.support.design.widget.BottomNavigationView>

我错过了什么?androidstuido 是否仍然支持 android.support.design.widget.BottomNavigationView"

最佳答案

android.support.design.widget.BottomNavigationView 类由 design support library 提供.
它需要 com.android.support:design:28.0.0 依赖项。

您正在使用 androidx 库。
在这种情况下,您必须使用 Material Components Library .

它需要依赖:

implementation 'com.google.android.material:material:1.1.0'

组件是com.google.android.material.bottomnavigation.BottomNavigationView

关于android - 膨胀类 android.support.design.widget.BottomNavigationView 时出错 & 膨胀类 android.support.design.widget.BottomNavigationView 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58514519/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com