我正在尝试在 android 中实现芯片布局,我也将我的谷歌材料依赖项更新到了最新版本。但是 XML 文件引发了这个问题
Failed to find '@attr/shapeAppearanceSmallComponent' in current theme.
梯度文件
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://jitpack.io'
}
}
}
<!-- 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/colorPrimaryDark</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)
XML文件
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.chip.ChipGroup
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/chipGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.chip.Chip
android:id="@+id/chip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="text" />
</com.google.android.material.chip.ChipGroup>
Run Code Online (Sandbox Code Playgroud) xml android render material-design material-components-android