食物安全中心呼吁的EditText [英] Warning on EditText

查看:100
本文介绍了食物安全中心呼吁的EditText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图定义一个的EditText ,但这样的警告显示:

I'm trying to define an EditText but this warning is shown:

This text field does not specify an inputType or a hint.

的main.xml 的code是:

<EditText android:id="@+id/input" 
              android:layout_width="fill_parent" 
              android:layout_height="wrap_content" 
              android:text="@string/textTest" /> 

我该如何解决这个问题?

How can I fix it?

推荐答案

您可以添加一个提示

android:hint="This will appear to the user if he didn't enter something yet in the EditText"

inputType ,所以你可以present给用户一个更适合软键盘。因为他suposed在输入文本的的EditText

and a inputType so you could present to the user a better suited soft keyboard for the text he is suposed to enter in the EditText:

android:inputType="number"

将present软键盘与数字和各种标牌。
这些只是警告,可以忽略他们,但对于用户更好地贯彻落实。

will present a soft keyboard with only numbers and various signs.
Those are just warnings, you could ignore them but is better for the user to implement them.

这篇关于食物安全中心呼吁的EditText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆