用户界面是应用程序开发的重要组成部分,决定了应用程序是否美观、易用。通过本次实验熟悉 Android 用户界面的基本开发方法,了解在 Android 界面开发过程中常见的界面控件的使用方法。
设计一个自我介绍的界面。要求输入姓名、年级、性别、爱好、总结
比较简单不做解读
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="vertical"
tools:context=".MainActivity"
android:text="@string/app_name">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/name"/>
<EditText
android:id="@+id/edit_name"
android:layout_width="178dp"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="right">
<TextView
android:layout_width="wrap_content"