Вопрос

So, I have a holo light theme, I am developing for android 3.0 and in my main.xml graphical layout shows a black screen which is what i want, but when I run the app on my android emulator version 3.0, it has a white background.

I want to have a black background, but main.xml layout shows me black background only the emulator shows different, why ????

Thanks, I have been developing for a week, but it's quite annoying. Thanks !!

Это было полезно?

Решение

Eclipse - Android Graphical XML Editor

The key is to customize Android Graphical XML Editor(Lets call it AGXE) properly to match the exact outcome of your program. For this purpose there are several ways of customizations are available.

In your case you are using Holo.Light the for your application, in your AGXE theme customization(in the light blue highlight) might be Holo/Theme.Holo (or something else) which has a black appearance for blank space.

If you want to know how your app layout will look in Holo.Light theme you have to manually set your theme to Holo.Light/Theme.Holo.Light

There are other controls in the AGXE, which can be used to get the most accurate representation of your layout in real life/emulator you specified (highlighted)(If you want explanations for each ask in comments below).

If you want to set a black background as Theme.Holo, you just have to put a single line code in all your layout android:background="#000000" which will set your entire background as black instead of white (even in Theme.Holo.Light), or you can specify your theme as Theme.Holo.

Read more here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top