我是一个警告,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 />

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

<EditText /> This text field does not specify an inputType or a hint的更多相关文章

  1. EditText html 出现提示 This text field does not specify an inputType or a hint

      1 <EditText 2 android:layout_width="fill_parent" 3 android:layout_height="wrap_c ...

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

    android开发过程中突然发现的warning,EditText 报出 “This text field does not specify an inputType or a hint”   原因: ...

  3. 编辑控件的警告提示是:This text field does not specify an inputType or a hint

    没有设置editText的inputtype属性,比如<android:inputtype="textpassword"> http://binuu.blog.51ct ...

  4. 从零开始学ios开发(四):IOS控件(1),Image View、Text Field、Keyboard

    长话短说,谢谢大家的关注,这篇写了好长时间,下面继续学习ios.我将用2到3篇的篇幅来学习iphone上的一些常用控件,包括Image View.Text Field.Keyboard.Slider等 ...

  5. 当开始输入文字以及完成文字输入时,变换text field的背景以及系统自带一键删除的 叉叉

    当开始输入文字以及完成文字输入时,变换text field的背景. -(BOOL) textFieldShouldBeginEditing:(UITextField *)textField{ [tex ...

  6. 限制 Text Field 输入的内容类型:只允许输入数字

    效果如下: ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController< ...

  7. 一行代码轻松修改 Text Field 和 Text View 的光标颜色 — By 昉

    众所周知,Text Field 和 Text View 的光标颜色默认都是系统应用的那种蓝色,如图: 而在实际开发中为了让视觉效果更统一,我们可能会想把那光标的颜色设置成和界面色调一致的颜色.其实在 ...

  8. 问题; No label views point to this text field with an android:labelFor="@+id/@+id/editTextNumber1" attribute

    设置完EditText的ID后老是报一个警告. 解决方法: 需要在EditText属性中添加inputType和labelFor两个属性.其中labelFor属性的值与id值相同即可

  9. SQL Server text field里面有换行符的时候copy到excel数据会散乱

    解决方法: select '"'+convert(varchar(8000),testField)+'"'astestField from testTable 这样虽然结果集里面有 ...

随机推荐

  1. spring boot application properties配置详解

    # =================================================================== # COMMON SPRING BOOT PROPERTIE ...

  2. 爬虫总结_java

    基于webmagic的爬虫项目经验小结 大概在1个月前,利用webmagic做了一个爬虫项目,下面是该项目的一些个人心得,贴在这里备份: 一.为什么选择webmagic? 说实话,开源的爬虫框架已经很 ...

  3. KDB支持单步调试功能(ARM架构)

    0    实践发现KDB不支持step调试功能 (本文针对的是arm CotexA9架构,各种架构的实现方式不一样,    X86的好像已经支持,不过本人没有验证过) 1    首先看下要调试的代码段 ...

  4. 如何在使用摩托罗拉上的RSS阅读器应用进行一次订阅

    订阅一个CSDN的RSS为例. 1.打开RSS阅读器. 2.设置->新增订阅->手动新增 订阅URL:输入http://articles.csdn.net/api/rss.php?tid= ...

  5. bootstrap之WaitForIdle&amp;&amp;Clear

    (上篇文章写完才发现.说好的按顺序可是回头一看全然不是按顺序的)明明WaitForIdle才是第一个.哎,老了,后脑勺不行了. WaitForIdle package io.appium.androi ...

  6. 枚举类型互相转换(使用GetEnumName和TypeInfo两个函数)

    usesClasses,TypInfo ; typeTCommandType = (ctEmptyCommand,ctAdd,ctModify); TCommandTypeConvert=classp ...

  7. SQL中EXISTS的用法(转)

    比如在Northwind数据库中有一个查询为SELECT c.CustomerId,CompanyName FROM Customers cWHERE EXISTS(SELECT OrderID FR ...

  8. 更改windows系统语言,改为英文

  9. (76) Clojure: Why would someone learn Clojure? - Quora

    (76) Clojure: Why would someone learn Clojure? - Quora ★ Why would someone learn Clojure?   Edit

  10. 硬盘重装Ubuntu12.04的感受

    好久没更blog了,最近这两天系统也出了问题,win7蓝屏,ubuntu进不去-.后来win7整好了,ubuntu依旧顽固.用惯了linux,就不想在转到win7下面了,估计是习惯了各种敲命令的感觉吧 ...