我是Android Studio的初学者,我遵循了本教程https://www.simplifiedcoding.net/bottom-navigation-android-example/
甚至当我下载它时,它也会返回此错误1,这是我的文件样式.xml代码,但是显示错误的文件我没有使用它们`
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
`
设计导航出现的唯一位置是在我的activity_main.xml
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
app:itemIconTint="@color/colorNavIcon"
app:itemTextColor="@color/colorNavText"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/navigation" />
答案 0 :(得分:0)
Android资产打包工具(AAPT)会为您的活动获取应用程序res
文件,例如AndroidManifest.xml
和xml
文件,并进行编译。
有时可能会发生AAPT错误,因此请尝试在Clean
和Rebuild
之后重启android studio