一,项目实验——Android 线性布局

本文介绍了在Android开发中使用线性布局实现注册个人信息界面的项目实验,包括布局结构、组件设置和按钮设计。通过实际操作,学习者将掌握LinearLayout的使用方法和活动间通信。
摘要由CSDN通过智能技术生成
目录链接
一,项目实验——Android 线性布局http://t.csdnimg.cn/yDK2c
二,项目实验——Android 约束布局http://t.csdnimg.cn/TS73B
三,个性化定制App登录界面http://t.csdnimg.cn/x7q7D
四,项目实验——Activity与Intenthttp://t.csdnimg.cn/BlTbs

一. 简答题(共1题,100分)

1,(简答题)(1)项目目标:掌握线性布局的使用方法及应用。
(2)项目任务:使用线性布局完成UI界面的设计。
(3)任务内容:

  • 任务:使用LinearLayout完成一个“注册个人信息”的布局。
  • 创建项目LinearLayoutDemo,包名:cn.edu.baiyunu.linearlayoutdemo,Language:Java 。
  • 组件树如下图所示:

在这里插入图片描述

  • 运行效果图:

在这里插入图片描述
实验1运行效果图

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:orientation="vertical"
    android:background="@drawable/img2"
    >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="注册个人信息"
        android:layout_gravity="center"
        android:layout_marginTop="50dp"
        android:textSize="30dp"
        />
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="请输入名字"
    />
    <EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="请输入证件类型"
    />
   <EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="请输入身份证号"
    />
   <EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="请输入联系电话"
    />


   <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:gravity="bottom"
       android:layout_marginBottom="20dp"
       >
       <Button
           android:layout_width="0dp"
           android:layout_weight="1"
           android:layout_height="wrap_content"
           android:text="提交"

           />
       <Button
           android:layout_width="0dp"
           android:layout_weight="1"
           android:layout_height="wrap_content"
           android:text="重置"
           />
       <Button
           android:layout_width="0dp"
           android:layout_weight="1"
           android:layout_height="wrap_content"
           android:text="取消"
           />
   </LinearLayout>

</LinearLayout>

在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值