Android基本组件

这篇博客介绍了一个Android应用程序的实现,包括两个界面。第一个界面让用户输入姓名、性别、职业、婚否和爱好,然后通过Intent将数据传递到第二个界面。在第二个界面中,数据被显示在一个ListView上,呈现用户的输入信息。
摘要由CSDN通过智能技术生成

(1) 设置两个界面,第一个界面输入姓名、性别、职业、婚否、爱好等,将这些输入信息转到第二个界面并用ListView显示出来
(1) 界面布局:
MainActivity.xml:

<?xml version="1.0" encoding="utf-8"?>

<android.support.constraint.ConstraintLayout 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”
tools:context=".MainActivity">

<GridLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="姓名:"
            android:textSize="18dp" />

        <EditText
            android:id="@+id/et_username"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </TableRow>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="性别:" />
<RadioGroup
android:id="@+id/radio_sex"
android:layout_width="match_parent"
android:layout_height="wrap_content">
    <RadioButton
        android:id="@+id/radio_boy"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="男" />
    <RadioButton
        android:id="@+id/radio_girl"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="女" />
</RadioGroup>
    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="职业:"
            android:textSize="18dp" />

        <EditText
            android:id="@+id/et_professor"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </TableRow>
   <RadioGroup android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:id="@+id/Married">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="婚否:"
        android:textSize="18dp" />

    <RadioButton
        android:id="@+id/radio_YesMarrige"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="是" />

    <RadioButton
        android:id=&
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值