《移动软件开发》做一个app首页

一、实验目标

如何制作一个简单的app首页,了解父布局、线性布局的使用

二、实验步骤

1、首先创建他的父布局,同时将图片素材导入mipmapp文件,注意命名不能含有数字或者大写字母

2、新建ScrollView.

3、创建Scroll VIew内部父布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="match_parent" >
    <ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">
        <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        </LinearLayout>
      </SrollView>
     </LinearLayout>

4、创建顶部首页显示显示栏

设置宽高、文字、字体、样式、颜色、字体居中等:

    <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
        <TextureView
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:gravity="center"
            android:text="首页"
            android:textColor="#333"
            android:textSize="18dp"
            android:textStyle="bold" />

5、创建顶部照片

设置宽高、src加载、给图片设置边距

     android:textColor="#333"
                android:textSize="18dp"
                android:textStyle="bold" />
​
            <ImageView
                android:layout_marginRight="10dp"
                android:layout_marginLeft="10dp"
                android:src="@mipmap/testimg"
                android:layout_width="match_parent"
                android:layout_height="200dp"/>

6、设置菜单栏模块

(1)创建一个横向的LinearLayout作为 菜单栏的父布局

(2)再创建一个LinearLayout来作为单个按钮的父布局

(3)创建图片按钮,设置其属性

(4)设置按钮底部文字和其属性

 <LinearLayout
                android:layout_marginTop="0dp"
                android:layout_marginRight="10dp"
                android:layout_marginLeft="10dp"
                android:weightSum="4"
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
​
​
        <LinearLayout
            android:orientation="vertical"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="100dp">
​
            <ImageView
                android:layout_marginTop="10dp"
                android:layout_gravity="center_horizontal"
                android:background="@mipmap/testicon"
                android:layout_width="50dp"
                android:layout_height="50dp"/>
​
            <TextView
                android:layout_marginTop="10dp"
                android:gravity="center"
                android:text="验房"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
                </LinearLayout>
​

7、消息模块的实现

(1)创建一个横向的LinearLayout作为菜单栏的父布局

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值