我是一个警告,xml代码是:

<EditText    android:id="@+id/str_ipaddress"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:ems="10"    android:inputType="text" />

改成

<EditText    android: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 />

  添加后黄色叹号就消失了。

更多相关文章

  1. Android清单文件属性大全
  2. android:layout_weight 属性对于组件长度的影响
  3. Android(安卓)RelativeLayout 属性
  4. Android学习笔记之mainfest文件中android属性
  5. android Activity
  6. android TextView属性大全
  7. Wifi广播状态
  8. RelativeLayout用到的一些重要的属性
  9. Android(安卓)Application 之 allowBackup 属性浅析

随机推荐

  1. Android文件图片上传的详细讲解(四)---服务
  2. Android 6.0 动态权限申请实例
  3. Caused by: java.lang.NoSuchMethodExcep
  4. Android点击事件隐藏软键盘
  5. Android Studio:常见使用问题处理
  6. MediaScanner与音乐信息扫描==
  7. 打开app弹出欢迎界面,然后自动跳转到主界
  8. 清除手机图案解锁(执行adb命令工具类)
  9. Android 中主Activity和任一Activity进行
  10. 将Android(安卓)Activity设置成对话框式