Issue
I'm struggling to set the right style for my button in the project. I don't know why shapeAppearance
not working. Even if I use only cornerSize
it's not working.
I have a base style for a button:
<style name="SnButton" parent="Widget.MaterialComponents.Button.UnelevatedButton">
<item name="shapeAppearance">@style/MyShapeAppearance</item>
<item name="backgroundTint">@null</item>
</style>
This is my shape appearance for a button:
<style name="MyShapeAppearance" parent="ShapeAppearance.MaterialComponents.SmallComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">2dp</item>
</style>
This is my base theme: Theme.MaterialComponents.Light.NoActionBar.Bridge
What should I do to force shapeAppearance
work in my case? Or at least cornerSize
?
Solution
I figured out why style was not working!
The problem was in the way I set the color for the button. I've used android:background
, but backgroundTint
must be used.
Answered By - Skullper
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.