日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

EditText / This text field does not specify an inputType or a hint

發布時間:2025/7/14 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。