为什么背景色不能分配给视图

问题描述 投票:0回答:1

我已经在color.xml文件中声明了白色和黑色值,试图将其用作两个给定视图的背景色,但是该视图正在接受它。

<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">是我的主题。

enter image description here

android view material
1个回答
0
投票

使用android:backgroundTint="@color/black"

© www.soinside.com 2019 - 2024. All rights reserved.