团委干部培训课件:Android开发笔记(五)— 更改手机窗口底色
来源:百度文库 编辑:中财网 时间:2024/04/20 05:22:59
指定Layout背景最简单的方法,通常是把颜色的常数定义在darwable当中,这个范例我们要把背景变成白色。
设计思路:
- 在values下面新建一个color.xml,定义两个颜色,一个是白色name="white",值为#ffffffff。一个是灰色name="darkgray",值为#808080FF。
- 对main.xml布局文件增加两个TextView,和两个EditText。TextView使用android:textColor设置颜色为darkgray。设置全局背景android:background颜色为white。并且全局使用绝对定位。
EX03_02.java
package dan.ex03_02;
import android.app.Activity;
import android.os.Bundle;
public class EX03_02 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
main.xml
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/white"
xmlns:android="http://schemas.android.com/apk/res/android"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/str_id"
android:textColor="@drawable/darkgray"
android:layout_x="61px"
android:layout_y="69px"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/str_psw"
android:textColor="@drawable/darkgray"
android:layout_x="61px"
android:layout_y="158px"
>
android:layout_width="120dip"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_x="114px"
android:layout_y="57px"
>
android:layout_width="120dip"
android:layout_height="wrap_content"
android:textSize="18sp"
android:password="true"
android:layout_x="112px"
android:layout_y="142px"
>
string.xml
color.xml
运行效果如下:
Internet IntraWeb开发学习笔记(三)b.htm
paranoid android中文歌词
radiohead 的 Paranoid Android 中文翻译
请问哪里有复旦人力资源开发与管理笔记
C语言手机开发
java手机游戏开发?
如何更改手机密码???
三星手机图片更改
手机文字显示更改
如何更改手机主页
更改手机游戏屏幕分辨率
周笔畅(笔记)歌词
五笔直能车更改文章
嵌入式开发和手机编程
什么是五码手机?
qq如何更改绑定手机
怎么样更改手机下载极限!?
手机密码怎样更改呢?
手机归属地如何更改
手机背景为什么更改失败?
怎么更改手机密码联通
(笔记)的原唱是谁?
求一款手机(一百万像素,一千五左右)???
高科技开发人才五同教育培训中心在哪