使用
android.support.design.widget.TextInputLayout
例如:
1 <android.support.design.widget.TextInputLayout 2 android:id="@+id/passwordWrapper" 3 android:layout_width="match_parent" 4 android:layout_height="wrap_content" 5 android:layout_marginTop="4dp"> 6 7 <EditText 8 android:id="@+id/login_et_password" 9 android:layout_width="match_parent" 10 android:layout_height="wrap_content" 11 android:hint="@string/login_hint_pwd" 12 android:inputType="textPassword" 13 android:padding="10dp" 14 android:textSize="14sp" /> 15 </android.support.design.widget.TextInputLayout>
http://www.jianshu.com/p/35080eb5a28f
原文:http://www.cnblogs.com/beens/p/5829317.html