How can I add the new android chips dynamically in Android?

前端 未结 2 1637
悲哀的现实
悲哀的现实 2021-02-12 11:53

I have a class called Question which contains a String array of tags. I\'m trying to show every question in a Recyclerview using Kotlin and every tag in a new chip. These chips

2条回答
  •  庸人自扰
    2021-02-12 12:01

    I always got the following error when trying to create a new Chip:

    IllegalArgumentException: This component requires that you specify a valid android:textAppearance attribute

    This could be fixed by instead inflating a custom R.layout.chip with the following line: android:textAppearance="@style/TextAppearance.MaterialComponents.Chip"

提交回复
热议问题