下载此文档

Android课程设计.ppt


文档分类:IT计算机 | 页数:约31页 举报非法文档有奖
1/31
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/31 下载此文档
文档列表 文档介绍
Android 课程设计
陈宇
本章目标
掌握按钮组件类的定义格式;
可以在Activity中定义按钮;
EditText组件的使用;
掌握RadioGroup类和RadioButton类的使用;
掌握下拉列表Spinner的使用;
可以通过程序配置Spinner显示内容;
可以通过配置文件配置Spinner显示内容。
按钮组件:Button
按钮在人机交互截面上使用的是最多的,当提示用户进行某些选择的时候,就可以通过按钮的操作来接收用户的选择。在Android使用“<Button>”组件可以定义出一个显示的按钮,并且可以在按钮上指定相应的显示文字,Button类的继承结构如下:





<?xml version="" encoding="utf-8"?>
<LinearLayout  定义线型布局管理器
xmlns:android="http://schemas./apk/res/android"
android:orientation="vertical"  所有组件垂直摆放
android:layout_width="fill_parent"  布局管理器宽度为屏幕宽度
android:layout_height="fill_parent">  布局管理器高度为屏幕高度
<Button  定义按钮组件
android:id="@+id/mybut1"  定义此按钮组件的ID,为Activity程序使用
android:layout_width="fill_parent"  宽度为整个容器的宽度
android:layout_height="wrap_content"  高度为文字高度
android:textColor="#FFFF00"  文字的颜色设置为黄色的RGB码
android:textSize="12px"  设置文字大小为12像素
android:text="湖北二师"/>  设置默认的显示文本
</LinearLayout>

<?xml version="" encoding="utf-8"?>
<LinearLayout  定义线型布局管理器
xmlns:android="http://schemas./apk/res/android"
android:orientation="vertical"  所有组件垂直摆放
android:layout_width="fill_parent"  布局管理器宽度为屏幕宽度
android:layout_height="fill_parent">  布局管理器高度为屏幕高度
<Button  定义按钮组件
android:id="@+id/mybut2"  定义此按钮组件的ID,为Activity程序使用
android:layout_width="fill_parent"  宽度为整个容器的宽度
android:layout_height="wrap_content"  高度为文字高度
android:text="CLICK"  设置默认的显示文本
android:layout_margin="30px"/>  距离左边30个像素的距离
</LinearLayout>

<?xml version="" encoding="utf-8"?>
<LinearLayout  定义线型布局管理器
xmlns:android="http://schemas./apk/res/android"
android:orientation="vertical"  所有组件垂直摆放
android:layout_width="fill_parent"  布局管理器宽度为屏幕宽度
android:layout_height="fill_parent">  布局管理器高度为屏幕高度
<Button  定义按钮组件
android:id="@+id/mybut3"  定义此按钮组件的ID,为Activity程序使用
android:layout_width="fill_parent"  宽度为整个容器的宽度
android:layout_height="wrap_content"  高度为文字高度
android:text="陈宇老师"  设置默认的显示文本

Android课程设计 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数31
  • 收藏数0 收藏
  • 顶次数0
  • 上传人zxwziyou8
  • 文件大小163 KB
  • 时间2018-05-25