<?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"
tools:context=".MainActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- TextView文本款的使用-->
<!-- <TextView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center"-->
<!-- android:text="Hello Android!"-->
<!-- android:textColor="#2023ff"-->
<!-- android:textSize="30sp" />-->
<!-- EditText输入框的使用-->
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请登录输入账号">
</EditText>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="请登录输入密码">
</EditText>
</LinearLayout>
一、hint
属性android:hint 用于设置EditText没有输入内容时显示的提示文本。
二、inputType
属性android:inputType用于设置输入文本类型,例如textPassword表示输入的文本是密码类型,则显示为“.”,还有date日期类型、phone电话类型等。