王学岗ToolBar,DrawLayout+Navigation的使用(四)——InputTextLayout

来源:互联网 发布:三福百货 java开发 编辑:程序博客网 时间:2024/06/02 05:25

InputTextLayout 属于design包,是一个容器,容器中只能放置一个元素,这和ScroollView类似;不同的是,InputtextLayout里面只能放置EditText;

<?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:orientation="vertical"    android:layout_height="match_parent"    tools:context="com.example.inputtextlayouttest.MainActivity">    <android.support.design.widget.TextInputLayout        android:id="@+id/til_one"        android:layout_width="match_parent"        app:hintAnimationEnabled="true"        app:errorEnabled="true"        android:layout_height="wrap_content">        <EditText            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:hint="请输入用户名"/>    </android.support.design.widget.TextInputLayout>    <android.support.design.widget.TextInputLayout        android:id="@+id/til_two"        android:layout_marginTop="300dp"        android:layout_width="match_parent"        android:layout_height="wrap_content">        <EditText            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:hint="请输入密码"/>    </android.support.design.widget.TextInputLayout></LinearLayout>
原创粉丝点击