Pavel Poley
Pavel Poley

Reputation: 5587

material chip text size is ignored

I want to change text size of material chip

<com.google.android.material.chip.Chip
            android:id="@+id/chipHalf"
            style="@style/ChipStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/half"
            android:textAllCaps="true"
            android:textColor="@color/text_black" />

style resource

<style name="ChipStyle" parent="Widget.MaterialComponents.Chip.Choice">
   <item name="android:textAppearance">@style/ChipSmallTextAppearance</item>
</style>

<style name="ChipSmallTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
    <item name="textSize">8sp</item>
</style>

But the text size not applied

Upvotes: 0

Views: 788

Answers (1)

Dali Hamza
Dali Hamza

Reputation: 597

change this

<item name="textSize">8sp</item>

to

<item name="android:textSize">8sp</item>

Upvotes: 2

Related Questions