I am making an UI on Android Studio.
I want to make a button with background image that I made.
Then I want to write some text on it.
However, when I set the background on button, it is just showing me black color.
I eidted theme.xml file to change status bar's color to black.
This is the background that I want to apply on button.
This picture showing that background image is not applied as I intended.
This is theme.xml file which I edited to change status bar's color.
CodePudding user response:
I found solution for this kind of issue!
it is because of Material components in theme.xml.
all you need to add to fix this is:
<style name="btn_style" parent="Widget.MaterialComponents.Button">
<item name="backgroundTint">@null</item>
</style>
Write this code in your theme.xml. Then reference it to your button.
CodePudding user response:
I've experienced such before. Change Button to appCompatButton