如何改变在Android应用程序背景颜色 [英] How to change background color in android app

查看:152
本文介绍了如何改变在Android应用程序背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够改变背景颜色为白色在我的Andr​​oid应用程序在可能的最简单的方法。

I want to be able to change the background color to white in my android app in the simplest way possible.

推荐答案

您需要使用android:background属性,如:

You need to use the android:background property , eg

android:background="@color/white"

另外,你需要为白中的strings.xml添加值

Also you need to add a value for white in the strings.xml

<color name="white">#FFFFFF</color>

编辑:二零一二年十一月一十八日

Edit : 18th Nov 2012

的8个字母的颜色code中的前两个字母提供alpha值,如果您使用的是HTML 6字母色彩符号的颜色是不透明的。

The first two letters of an 8 letter color code provide the alpha value, if you are using the html 6 letter color notation the color is opaque.

例如:

这篇关于如何改变在Android应用程序背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆