EditText / This text field does not specify an inputType or a hint
生活随笔
收集整理的這篇文章主要介紹了
EditText / This text field does not specify an inputType or a hint
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我是一個警告,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" />就好了。
為什么,因為新版本SDK要求填寫屬性lableFor,類似于填寫一個ID來綁定這個控件,第一句已經添加了一個id,直接用那個就行了
?
?
?
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 />??????? 這樣寫的時候突然發現有黃色的嘆號出現,提示:"This text field does not specify an inputType or a hint";
??????? 原因是這個編輯框缺少一個屬性: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 />? 添加后黃色嘆號就消失了。
轉載于:https://www.cnblogs.com/chen-lhx/p/3963658.html
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的EditText / This text field does not specify an inputType or a hint的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SmartOS之以太网精简协议栈Tiny
- 下一篇: 【转】PhpStorm 提交代码到远程G