方法1:
在xml文件中使用
android:background="#ffffff"
方法2:
在style.xml里添加一个新的style
如text:
<style name="text">
<item name="android:textSize">24sp</item>
<item name="android:textColor">#ff0000</item>
<item name="android:background">#111111</item>
</style>
在xml里套用style="@style/text"即可
PS. 在下边的背景颜色设置会覆盖上边的,若套用了背景为黑色的style,而在底下设置background,style里的其他设置不变,只有背景变为background里的颜色