我在我的佈局中有一個TextInputLayout,我想在它的提示中使用html標記或spannable,但它不起作用。是否可以在TextInputLayout提示中使用html標籤或spannable?
我搜索谷歌的所有鏈接,但結果是「現在是不可能的,也許在下一個版本和更新是可能的」。
是否可以自定義TextInputLayout視圖來接受提示中的html標籤?我該怎麼做?
我在我的佈局中有一個TextInputLayout,我想在它的提示中使用html標記或spannable,但它不起作用。是否可以在TextInputLayout提示中使用html標籤或spannable?
我搜索谷歌的所有鏈接,但結果是「現在是不可能的,也許在下一個版本和更新是可能的」。
是否可以自定義TextInputLayout視圖來接受提示中的html標籤?我該怎麼做?
添加以下代碼在佈局XML文件TextInputLayout:
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_horizontal_margin"
app:hintAnimationEnabled="false">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/enter_message" />
</android.support.design.widget.TextInputLayout>
在string.xml文件中添加以下代碼:
<string name="enter_message">Enter Message<font fgcolor="red">*</font></string>
添加一些代碼將是一個不錯的主意。 – iMDroid
@iMDroid感謝您的幫助 – hamed
@iMDroid去年提出了一個類似於我的問題。你有沒有找到解決方案? – hamed