本文介绍了为什么我的Andr​​oid模拟器具有不同的背景比main.xml中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我有一个全息光的主题,我为Android 3.0,在我main.xml中的图形布局显示黑屏这是我想要的开发,但是当我在我的Andr​​oid模拟器3.0版运行应用程序,它有一个白色的背景。

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.

我想有一个黑色的背景,但main.xml中布局显示了我黑色的背景仅模拟器显示不同,为什么????

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 !!

推荐答案

关键是要定制的Andr​​oid图形的XML编辑器(让我们把它叫做AGXE)正确匹配程序的确切结果。为此,有自定义的几种方式可供选择。

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.

在你的情况,你所使用的Holo.Light您的应用程序,在你的AGXE主题定制(在淡蓝色高亮显示)可能的霍洛/ Theme.Holo (或别的东西),其中有一个黑色的外观为空白。

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.

如果你想知道你的应用程序布局将如何看在Holo.Light主题,你有你的主题手动设置为 Holo.Light / Theme.Holo.Light

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

有在AGXE其他控件,它可以被用来获取最准确的重新$ P $在现实生活中/仿真器布局的指定psentation(高亮)(如果你想为每个解释在评论问下文)

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).

如果你想设置一个黑色背景Theme.Holo,你只要把一个单行code在所有布局的android:背景=#000000这将设置你的整个背景为黑色而不是白色(即使在Theme.Holo.Light),或者你可以指定你的主题为Theme.Holo。

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.

这篇关于为什么我的Andr​​oid模拟器具有不同的背景比main.xml中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 05:53