This text field does not specify an inputType or a hint
16lz
2021-12-04
1 <EditText2 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 <EditText2 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 />
添加后黄色叹号就消失了。
更多相关文章
- Android(安卓)LinearLayout 嵌套 button 监听LinearLayout的onCl
- ListView滚动条问题
- Android控件属性大全
- Android控件属性大全
- 解决android TextView多行文本(超过3行)使用ellipsize属性无效问题
- android布局属性大全
- Android(安卓)ScrollView 内部控件 layout_margin失效的解决方法
- Android属性设置大全
- Android控件基本属性介绍