當我在選項卡布局中使用數據綁定庫時,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你能夠基於下面的答案來解決問題了嗎? –