0

I am adding pictures to my Android project and the background color of those pictures are the darkest of the darkest color (RGB: 0, 0, 0) but I can see the background color of the images is different from the background color of the android activities.

What is the default RGB color code for the activity backgrounds or is there a method to get it?

(Yes, I know that I could change the background color of the activities to the desired color instead, but that would require that I change all my activities' background color)

4

1 回答 1

0

正如 Warpzit 建议的那样,我研究了样式,以下解决了我的问题:

在“values”文件夹中创建一个 XML 文件,其中包含以下代码:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="BackgroundStyle" parent="@android:style/Animation.Activity">
        <item name="android:background">#000000</item>
    </style>
</resources>

在每个布局 XML 文件中,在 LinearLayout 标记内添加以下内容:

style="@style/BackgroundStyle"
于 2012-07-05T12:30:26.070 回答