TextInputLayout基本使用
来源:互联网 发布:帝国cms好还是织梦好 编辑:程序博客网 时间:2024/06/09 15:34
TextInputLayout的主要作用是作为EditText的容器,从而为EditText默认生成一个浮动的Label,当用户点击EditText之后,EditText中设置的hint字符串会自动移动到EditText的左上角。但是我发现当完之后那个hint不消失。。哎,可能是我没有用好style,等我再使用一下会贴出来。
使用代码和效果如下:
<?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:layout_height="match_parent" android:orientation="vertical" tools:context="shen.da.ye.textinputlayout.MainActivity"> <android.support.design.widget.TextInputLayout android:layout_width="368dp" android:layout_height="wrap_content" app:errorEnabled="true" app:errorTextAppearance="@style/TextAppearance.Design.Error" tools:layout_editor_absoluteX="8dp" tools:layout_editor_absoluteY="0dp"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入数字号码" android:imeOptions="actionGo" android:inputType="number" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="368dp" android:layout_height="wrap_content" app:errorEnabled="true" app:errorTextAppearance="@style/TextAppearance.Design.Error" tools:layout_editor_absoluteX="8dp" tools:layout_editor_absoluteY="0dp"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入数字号码2" android:imeOptions="actionGo" android:inputType="number" /> </android.support.design.widget.TextInputLayout></LinearLayout>
阅读全文
0 0
- TextInputLayout基本使用
- 使用TextInputLayout
- TextInputLayout、Snackbar使用
- TextInputLayout 的简单使用
- TextInputLayout的使用
- TextInputLayout的使用
- TextInputLayout的使用
- TextInputLayout 的使用
- TextInputLayout使用教程
- TextInputLayout的使用
- android TextInputLayout的使用
- TextInputLayout&TextInputEditText的使用
- TextInputLayout的简单使用
- TextInputLayout的使用
- Android TextInputLayout 使用
- TextInputLayout的使用
- textInputLayout使用简介
- TextInputLayout的使用
- SSIS异常--SSIS FTP Task Variable Remote Path invalid
- 在 CentOS7 上安装 MySQL5.7
- Ubuntu top显示进程在CPU的哪个核
- 性能分析3~jstack命令分析:死锁原因、cpu使用率过高的线程
- ant环境配置
- TextInputLayout基本使用
- Elasticsearch在页面上设置max_result_window
- 1056:明明的随机数
- iOS The 'Apple Developer Program License Agreement' has been updated. In order to access certain mem
- Java NIO系列教程(五) 通道之间的数据传输
- C++虚函数简单总结
- hi,my first
- MTK(Android N)设置SDCard为默认存储
- java虚拟机(一)--内存区的划分