先导入依赖 compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:design:25.0.0' 布局文件<?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" > <android.support.design.widget.TextInputLayout android:textColorHighlight="#00ff00" android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/user" android:layout_height="wrap_content" android:layout_width="match_parent" android:hint="请输入用户名" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <EditText android:id="@+id/pass" android:hint="请输入密码" android:inputType="textPassword" android:layout_width="match_parent" android:layout_height="wrap_content" /> </android.support.design.widget.TextInputLayout> </LinearLayout>
TextInputLayout
最新推荐文章于 2019-06-12 15:38:49 发布