2022年夏季《移动软件开发》实验报告 实验6:做一个APP首页

2022年夏季《移动软件开发》实验报告

本实验属于哪门课程?中国海洋大学22夏《移动软件开发》
实验名称?实验6:做一个APP首页

一、实验目标

1、学习ScrollView使用

2、学习RelativeLayout使用

3、学习插件之间的穿插使用

二、实验步骤

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:orientation="horizontal">
​
   <ScrollView
       android:layout_width="match_parent"
       android:layout_height="match_parent">
​
       <RelativeLayout
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:orientation="horizontal">
​
           <TextView
               android:id="@+id/text1"
               android:layout_width="match_parent"
               android:layout_height="50dp"
               android:gravity="center"
               android:text="首页"
               android:textColor="#333"
               android:textSize="18dp"
               android:textStyle="bold"/>
​
           <ImageView
               android:id="@+id/imgtop"
               android:layout_below="@id/text1"
               android:layout_width="match_parent"
               android:layout_height="200dp"
               android:layout_marginLeft="10dp"
               android:layout_marginRight="10dp"
               android:src="@mipmap/test_img" />
​
           <RelativeLayout
               android:id="@+id/imgtop2"
               android:layout_below="@id/imgtop"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:layout_marginLeft="10dp"
               android:layout_marginRight="10dp"
               android:orientation="horizontal"
               android:weightSum="4">
​
               <RelativeLayout
                   android:id="@+id/a1"
                   android:layout_width="100dp"
                   android:layout_height="100dp"
                   android:layout_weight="1"
                   android:orientation="vertical">
​
                   <ImageView
                       android:id="@+id/img1"
                       android:layout_width="50dp"
                       android:layout_height="50dp"
                       android:layout_centerHorizontal="true"
                       android:layout_gravity="center_horizontal"
                       android:layout_marginTop="10dp"
                       android:background="@mipmap/test_icon1" />
​
                   <TextView
                       android:layout_width="match_parent"
                       android:layout_height="wrap_content"
                       android:layout_below="@id/img1"
                       android:layout_marginTop="10dp"
                       android:gravity="center"
                       android:text="验房" />
​
               </RelativeLayout>
​
               <RelativeLayout
                   android:id="@+id/a2"
                   android:layout_toRightOf="@id/a1"
                   android:layout_width="100dp"
                   android:layout_height="100dp"
                   android:layout_weight="1"
                   android:orientation="vertical">
​
                   <ImageView
                       android:layout_centerHorizontal="true"
                       android:id="@+id/img2"
                       android:layout_width="50dp"
                       android:layout_height="50dp"
                       android:layout_gravity="center_horizontal"
                       android:layout_marginTop="10dp"
                       android:background="@mipmap/test_icon2" />
​
                   <TextView
                       android:layout_below="@id/img2"
                       android:layout_width="match_parent"
                       android:layout_height="wrap_content"
                       android:layout_marginTop="10dp"
                       android:gravity="center"
                       android:text="日常巡检" />
               </RelativeLayout>
​
               <RelativeLayout
                   android:id="@+id/a3"
                   android:layout_toRightOf="@id/a2"
                   android:layout_width="100dp"
                   android:layout_height="100dp"
                   android:layout_weight="1"
                   android:orientation="vertical">
​
                   <ImageView
                       android:layout_centerHorizontal="true"
                       android:id="@+id/img3"
                       android:layout_width="50dp"
                       android:layout_height="50dp"
                       android:layout_gravity="center_horizontal"
                       android:layout_marginTop="10dp"
                       android:background="@mipmap/test_icon3" />
​
                   <TextView
                       android:layout_below="@id/img3"
                       android:layout_width="match_parent"
                       android:layout_height="wrap_content"
                       android:layout_marginTop="10dp"
                       android:gravity="center"
                       android:text="钥匙管理" />
​
               </RelativeLayout>
​
               <RelativeLayout
                   android:layout_toRightOf="@id/a3"
                   android:layout_width="100dp"
                   android:layout_height="100dp"
                   android:layout_weight="1"
                   android:orientation="vertical">
​
                   <ImageView
                       android:layout_centerHorizontal="true"
                       android:id="@+id/img4"
                       android:layout_width="50dp"
                       android:layout_height="50dp"
                       android:layout_gravity="center_horizontal"
                       android:layout_marginTop="10dp"
                       android:background="@mipmap/test_icon4" />
​
                   <TextView
                       android:layout_below="@id/img4"
                       android:layout_width="match_parent"
                       android:layout_height="wrap_content"
                       android:layout_marginTop="10dp"
                       android:gravity="center"
                       android:text="统计分析" />
​
               </RelativeLayout>
​
           </RelativeLayout>
​
           <RelativeLayout
               android:layout_below="@id/imgtop2"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:layout_marginTop="20dp"
               android:orientation="horizontal">
​
               <TextView
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:layout_marginLeft="10dp"
                   android:layout_weight="1"
                   android:text="待办(10)"
                   android:textColor="#333"
                   android:textSize="16dp"
                   android:textStyle="bold" />
​
               <TextView
                   android:layout_alignParentRight="true"
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:layout_marginLeft="10dp"
                   android:layout_marginRight="10dp"
                   android:text="更多"
                   android:textColor="#666" />
​
           </RelativeLayout>
​
​
​
       </RelativeLayout>
   </ScrollView>
​
   <LinearLayout
       android:layout_alignParentBottom="true"
       android:layout_width="match_parent"
       android:layout_height="80dp"
       android:weightSum="4">
​
       <RelativeLayout
           android:layout_width="50dp"
           android:layout_height="match_parent"
           android:layout_weight="1">
​
           <ImageView
               android:id="@+id/b1"
               android:layout_width="30dp"
               android:layout_height="30dp"
               android:layout_centerHorizontal="true"
               android:layout_marginTop="15dp"
               android:background="@mipmap/test_icon3" />
​
           <TextView
               android:layout_below="@id/b1"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:layout_centerHorizontal="true"
               android:layout_marginTop="5dp"
               android:gravity="center"
               android:text="首页" />
       </RelativeLayout>
​
       <RelativeLayout
           android:layout_width="50dp"
           android:layout_height="match_parent"
           android:layout_weight="1">
​
           <ImageView
               android:id="@+id/b2"
               android:layout_width="30dp"
               android:layout_height="30dp"
               android:layout_centerHorizontal="true"
               android:layout_marginTop="15dp"
               android:background="@mipmap/test_todo" />
​
           <TextView
               android:layout_below="@id/b2"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:layout_centerHorizontal="true"
               android:layout_marginTop="5dp"
               android:gravity="center"
               android:text="验房" />
       </RelativeLayout>
​
       <RelativeLayout
           android:layout_width="50dp"
           android:layout_height="match_parent"
           android:layout_weight="1">
​
           <ImageView
               android:id="@+id/b3"
               android:layout_width="30dp"
               android:layout_height="30dp"
               android:layout_centerHorizontal="true"
               android:layout_marginTop="15dp"
               android:background="@mipmap/test_excel" />
​
           <TextView
               android:layout_below="@id/b3"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:layout_centerHorizontal="true"
               android:layout_marginTop="5dp"
               android:gravity="center"
               android:text="统计" />
       </RelativeLayout>
​
       <RelativeLayout
           android:layout_width="50dp"
           android:layout_height="match_parent"
           android:layout_weight="1">
​
           <ImageView
               android:id="@+id/b4"
               android:layout_width="30dp"
               android:layout_height="30dp"
               android:layout_centerHorizontal="true"
               android:layout_marginTop="15dp"
               android:background="@mipmap/test_control" />
​
           <TextView
               android:layout_below="@id/b4"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:layout_centerHorizontal="true"
               android:layout_marginTop="5dp"
               android:gravity="center"
               android:text="设置" />
       </RelativeLayout>
​
   </LinearLayout>
</RelativeLayout>

三、程序运行结果

 

四、问题总结与体会

在本次实验中学习了ScrollView、RelativeLayout等,

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值