java - 更改 TextInputLayout 提示行为
问题描述
我需要以这种方式更改 TextInputLayout 行为。默认情况下,当用户单击布局内的 EditText 时,提示会离开文本框并位于上方。我需要实现的是:当用户点击 EditText 时,提示没有反应。当用户开始输入时它会移动,然后返回时 EditText 为空。
我使用了一个名为 FloatingEditText 的自定义库,但它不能与 RTL 布局一起正常工作。有谁知道如何使用 TextInputLayout 或其他从右到左工作的方式来实现这一点?
提前致谢!
解决方案
您可以在标签部分输入要输入的名称,在印度部分输入提示。
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Label">
<EditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
推荐阅读
- c++ - Marshal 管理非托管的无符号整数数组
- java - 在 PrintWriter 格式错误中使用 PrintStream
- reactjs - 在 Docker 中使用 React 和 Nginx 授权 Spotify
- kubernetes - Kubernetes 检查“静默” pod 是否完成执行
- typescript - 在 TypeScript 中手动 curry 一个 add 函数
- here-api - 我如何从带有输入搜索的表单中获取 searchText 映射 javascript
- bluetooth-lowenergy - 在描述符中结合键盘和消费者控制
- microsoft-graph-api - 无需授权完全读取权限即可获取忙/闲信息
- .net - ClientFactory http客户端请求卡住
- java - 正在重新初始化的变量的值