两种支持库都尝试过芯片组件
com.google.android.support:design:28.0.0-rc01和 Material
com.google.android.material:material:1.0.0-rc01
StackTrace



布局

<com.google.android.material.chip.Chip
    android:id="@+id/chip"
    style="style/Widget.MaterialComponents.Chip.Entry"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/account"
    app:closeIconEnabled="true" />`

最佳答案

更新您的应用程序主题以继承以下主题之一:

Theme.MaterialComponents
Theme.MaterialComponents.NoActionBar
Theme.MaterialComponents.Light
Theme.MaterialComponents.Light.NoActionBar
Theme.MaterialComponents.Light.DarkActionBar

例如:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">



资源:
https://www.material.io/develop/android/docs/getting-started/

07-24 09:37
查看更多