Android Studio button background color

Android Studio button background color change

Writing the front-end interface in Android Studio, modifying the background style of the Button has always been the default theme color
insert image description here
of the system. No matter how you change the color, it will be the default theme color of the system. Here we need to change
the Styles.xml or theme.xml file

Modify style.xml/theme.xml

insert image description here

<style name="Theme.Athena" parent="Theme.MaterialComponents.DayNight.DarkActionBar">

Add the statement at the end here: .Bridge

    <style name="Theme.Athena" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">

As shown in the figure below:
insert image description here
Modified effect:
insert image description here
* PS: I set the background color of the button here to be transparent *

Guess you like

Origin blog.csdn.net/weixin_50679163/article/details/115279933