android framelayout view上下层_移动应用开发:实验四:Android 用户界面

c4de5ef4ba91c6ee9687abcbd2bd7482.png

实验四 Android 用户界面

一、实验目的

1. 加深对用户界面的控件的理解和使用。

2.掌握各种界面布局的用法。

3.掌握选项菜单、子菜单和快捷菜单的使用方法。

二、实验内容

1. 建立一个“ButtonDemo”的程序,包含 Button 和 ImageButton 两个按钮,上方是 “Button 按钮”,下方是一个 ImageButton 控件?

2. 建立一个“CheckboxRadiobuttonDemo”程序,包含五个控件,从上至下分别是 TextView01 、 CheckBox01 、 CheckBox02 、 RadioButton01 、 RadioButton02 , 当选择 RadioButton01, RadioButton02 则无法选择?

3.建立一个“TabDemo”程序,包含三个 XML 文件,分别为 tab1.xml、tab2.xml 和 tab3.xml,这 3 个文件分别使用线性布局、相对布局和绝对布局示例中的 main.xml 的代码, 并将布局的 ID 分别定义为 layout01、layout02 和 layout03?

4.建立一个“MyContextMenu”程序,来完成 Android 菜单的功能。 三、实验仪器、设备 硬件:PC 微型计算机、1G 以上内存,40G 以上硬盘 软件:Windows XP,Eclipse , JDK , Android SDK

三、实验仪器、设备:

硬件:PC 微型计算机、1G 以上内存,40G 以上硬盘

软件:Windows XP,Eclipse , JDK , Android SDK

四、实验代码及结果

activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="10dp">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        > 
    <TextView android:id="@+id/TextView01"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/app_name"/>
    <Button android:id="@+id/Button01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button01" >
    </Button>
    <ImageButton android:id="@+id/ImageButton01"
        android:layout_width="150dp"
        android:layout_height="150dp">
    </ImageButton>


    <TextView android:id="@+id/TextView02"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="复选框调试"/>
    <CheckBox android:id="@+id/CheckBox01"
        android:layout_width="wrap_con
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值