当我在选项卡布局中使用数据绑定库时,EditText提示在键入后不会隐藏。EditText提示属性不起作用
<layout> <Edittext hint='enter your text'/> <layout>
当我在选项卡布局中使用数据绑定库时,EditText提示在键入后不会隐藏。EditText提示属性不起作用
<layout> <Edittext hint='enter your text'/> <layout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:hint="Caption..."
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textSize="20sp"/>
</RelativeLayout>
感谢您的建议,但不是为我工作,我已经试过这个解决方案 – chavantr
@chavantr请发布您的XML布局,我会帮你 –
尝试下面的代码:
<layout>
<data>
<variable
name="user"
type="com.project.User" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/phone_number"
android:text="@{user.userName}"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:hint="phone number" />
</LinearLayout>
可能这个链接将帮助您在EDITTEXT添加提示,并U将得到代码当用户在输入内容中删除它带有EditText提示颜色样式。 检查它..
试试这个代码
<EditText
android:id="@+id/reg_edu_edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:inputType="textPersonName"
android:hint=" Educational Qualification"
android:layout_marginTop="5dp"/>
分享您的布局代码 –
发表您的XML请 –
@chavantr你能够基于下面的答案来解决问题了吗? –