Warning on EditText

后端 未结 4 1073
后悔当初
后悔当初 2021-02-05 20:52

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

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

The code in

4条回答
  •  天涯浪人
    2021-02-05 21:11

    Above all are the solutions but before that you should understand what does that warnig mean.

    Hint:- Hint is the text shown to user before writing anything over. For eg. if you are putting a edittext where you want user to add his name then you can write

    
    

    Input Type:- This is the xml tag that is to be used within edittext to let edittext to follow that particular restriction. if you are giving inputtype:number then user would be able to enter only numbers. There are several input type fields are there for that you can refer official developer site.

提交回复
热议问题