When using Theme.MaterialComponents.Light.NoActionBar style, setting Button Background has no effect

前端 未结 2 1248
自闭症患者
自闭症患者 2021-02-01 02:39

In order to use Chip and ChipGroup, I set Application style extends Theme.MaterialComponents.Light.NoActionBar int manifests.xml, then I set Button \"android:backg

2条回答
  •  别那么骄傲
    2021-02-01 03:11

    In this particular case, the LinearLayout holding your second Button seems to have a white background color. That means you don't need to explicitly specify a white background for your Button; you can just let the LinearLayout's background show through.

    This can be accomplished by using the "Text Button" style of MaterialButton:

    style="@style/Widget.MaterialComponents.Button.TextButton"
    

提交回复
热议问题