Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android:背景不适用于主题为theme.MaterialComponents.DayNight.DarkActionBar的按钮_Android_Android Theme - Fatal编程技术网

android:背景不适用于主题为theme.MaterialComponents.DayNight.DarkActionBar的按钮

android:背景不适用于主题为theme.MaterialComponents.DayNight.DarkActionBar的按钮,android,android-theme,Android,Android Theme,android:background和android:textColor在应用程序主题为“theme.MaterialComponents.DayNight.DarkActionBar”时不在按钮上工作,但在主题为“theme.MaterialComponents.DayNight.DarkActionBar.Bridge”时工作 我想知道为什么以及如何在不改变主题的情况下解决此问题。Ref: 桥接主题继承自AppCompat主题,但也为您定义新的材质组件主题属性 因此,如果你的按钮没有根据你的

android:background和android:textColor在应用程序主题为“theme.MaterialComponents.DayNight.DarkActionBar”时不在按钮上工作,但在主题为“theme.MaterialComponents.DayNight.DarkActionBar.Bridge”时工作

我想知道为什么以及如何在不改变主题的情况下解决此问题。

Ref:

桥接主题继承自AppCompat主题,但也为您定义新的材质组件主题属性

因此,如果你的按钮没有根据你的愿望改变,你可以使用其中一个桥牌主题

Theme.MaterialComponents.Bridge
Theme.MaterialComponents.Light.Bridge
Theme.MaterialComponents.NoActionBar.Bridge
Theme.MaterialComponents.Light.NoActionBar.Bridge
Theme.MaterialComponents.Light.DarkActionBar.Bridge  

android:background
使用
按钮
材质组件
主题: