南昌航空大学android实验报告二.doc

上传人:b****1 文档编号:178841 上传时间:2022-10-05 格式:DOC 页数:11 大小:145.50KB
下载 相关 举报
南昌航空大学android实验报告二.doc_第1页
第1页 / 共11页
南昌航空大学android实验报告二.doc_第2页
第2页 / 共11页
南昌航空大学android实验报告二.doc_第3页
第3页 / 共11页
南昌航空大学android实验报告二.doc_第4页
第4页 / 共11页
南昌航空大学android实验报告二.doc_第5页
第5页 / 共11页
点击查看更多>>
下载资源
资源描述

南昌航空大学android实验报告二.doc

《南昌航空大学android实验报告二.doc》由会员分享,可在线阅读,更多相关《南昌航空大学android实验报告二.doc(11页珍藏版)》请在冰豆网上搜索。

南昌航空大学android实验报告二.doc

南昌航空大学实验报告

二0一二年十二月九日

课程名称:

移动终端编程技术实验名称:

Android用户界面编程

班级:

10201404姓名:

金林成宇同组人:

指导教师评定:

签名:

一、实验目的

了解Android编程原理,熟练掌握界面控件的使用;

熟练应用各种界面布局;掌握界面控件设计;掌握控件的事件处理编程

二、实验工具

Eclipse(MyEclipse)+ADT+Android2.2SDK;

三、实验题目

1.使用XML创建布局,设计一个登录界面;效果如图所示:

图1登录界面效果图

2.参考下图中界面控件的摆放位置,分别使用线性布局、相对布局和绝对布局实现用户界面,并对比各种布局实现的复杂程度和对不同屏幕尺寸的适应能力。

图2效果图

3.ListView的使用

图3初始界面图4点击一项后的界面

四、实验步骤

1.代码如下:

Main.xml

xmlversion="1.0"encoding="utf-8"?

>

android="

android:

layout_width="fill_parent"

android:

layout_height="fill_parent"

android:

orientation="vertical">

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

orientation="horizontal">

android:

id="@+id/UserText"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

text="@string/User"/>

android:

id="@+id/User"

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"/>

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

orientation="horizontal">

android:

id="@+id/PasswordText"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

text="@string/Password"/>

android:

id="@+id/Pssword"

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

password="true"/>

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

orientation="horizontal">

android:

id="@+id/CheckBox"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

text="@string/CheckBox"/>

android:

id="@+id/Submit"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

layout_marginLeft="100dip"

android:

text="@string/Submit"/>

2.自做;

线性布局

xmlversion="1.0"encoding="utf-8"?

>

android="

android:

orientation="vertical"

android:

layout_width="fill_parent"

android:

layout_height="fill_parent"

>

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

orientation="horizontal">

android:

id="@+id/NameText"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

text="姓名:

"/>

android:

id="@+id/Name"

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

text="king"/>

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

orientation="horizontal">

android:

id="@+id/AgeText"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

text="年龄:

"/>

android:

id="@+id/UserText"

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

text="30"/>

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

orientation="horizontal">

android:

id="@+id/HeightText"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

text="身高:

"/>

android:

id="@+id/Height"

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

text="1.75"/>

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

orientation="horizontal">

android:

id="@+id/Button1"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

text="添加数据"/>

android:

id="@+id/Button2"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

text="全部显示"/>

android:

id="@+id/Button3"

android:

layout_w

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1