EditText / This text field does not specify an inputType or a hint
生活随笔
收集整理的這篇文章主要介紹了
EditText / This text field does not specify an inputType or a hint
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
我是一個(gè)警告,xml代碼是:
<EditTextandroid:id="@+id/str_ipaddress"android:layout_width="wrap_content"android:layout_height="wrap_content"android:ems="10"android:inputType="text" />改成
<EditTextandroid:id="@+id/str_ipaddress"android:layout_width="wrap_content"android:layout_height="wrap_content"android:ems="10"android:inputType="text"android:labelFor="@id/str_ipaddress" />就好了。
為什么,因?yàn)樾掳姹維DK要求填寫屬性lableFor,類似于填寫一個(gè)ID來(lái)綁定這個(gè)控件,第一句已經(jīng)添加了一個(gè)id,直接用那個(gè)就行了
?
?
?
This text field does not specify an inputType or a hint
1 <EditText 2 android:layout_width="fill_parent" 3 android:layout_height="wrap_content" 4 android:minLines="3" 5 android:id="@+id/message" 6 />??????? 這樣寫的時(shí)候突然發(fā)現(xiàn)有黃色的嘆號(hào)出現(xiàn),提示:"This text field does not specify an inputType or a hint";
??????? 原因是這個(gè)編輯框缺少一個(gè)屬性:hint。
??????? hint屬性作用如下:
???????
? 修改后代碼為: ?
1 <EditText 2 android:layout_width="fill_parent" 3 android:layout_height="wrap_content" 4 android:minLines="3" 5 android:hint="@null" 6 android:id="@+id/message" 7 />? 添加后黃色嘆號(hào)就消失了。
轉(zhuǎn)載于:https://www.cnblogs.com/chen-lhx/p/3963658.html
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的EditText / This text field does not specify an inputType or a hint的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: SmartOS之以太网精简协议栈Tiny
- 下一篇: 【转】PhpStorm 提交代码到远程G