Skip to content Skip to sidebar Skip to footer

The Style On This Component Requires Your App Theme To Be Theme.materialcomponents (or A Descendant)

i am new to Android and i might have a silly / dumb Question. I have got an Activity where i want to dynamically create Multiple Input Fields. The amount of Input Fields is defined

Solution 1:

found the solution ,get your inflator from activity not application just modify your initLayout() like this

// here is the fixval inflater = getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater

Solution 2:

just set the theme on the chip itself using android:theme="@style/Theme.MaterialComponents.Bridge:

<com.google.android.material.chip.Chipxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"
      *****android:theme="@style/Theme.MaterialComponents.Bridge"****
    style="@style/CustomFiltersChipChoice"android:layout_width="wrap_content"android:layout_height="wrap_content"app:chipStrokeColor="#F0F"app:chipStrokeWidth="1dp"app:textEndPadding="10dp"app:textStartPadding="10dp"tools:chipText="my chip"tools:text="Fortune" />

Post a Comment for "The Style On This Component Requires Your App Theme To Be Theme.materialcomponents (or A Descendant)"