我是一个警告,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. 14.1.1 InnoDB as the Default MySQL Storage Engine

    14.1 Introduction to InnoDB 14.1.1 InnoDB as the Default MySQL Storage Engine 14.1.2 Checking InnoDB ...

  2. velocity中的velocityCounter不起作用的原因

    今天用org.springframework.ui.velocity.VelocityEngineFactoryBean 时,velocityCounter这个变量的时候死活不起作用,折腾了良久也不行 ...

  3. 10165 - Stone Game(Nim游戏)

    UVA 10165 - Stone Game 题目链接 题意:给定n堆石子,每次能在一堆取1到多个.取到最后一个赢,问谁赢 思路:就裸的的Nim游戏,利用定理求解 代码: #include <s ...

  4. Linux编程实现守护进程

    Linux 守护程序 守护进程(Daemon)它是在一个特定的过程的背景进行.它独立于控制终端的和周期性地执行某些任务或待某些事件.是一种非常实用的进程. Linux的大多数server就是用守护进程 ...

  5. 用scponly限制只能拷文件,不能登陆(MAC版)

    目的: 限制用户在特定目录(不能看到上级或者根目录) 只能执行scp或者sftp拷贝特别目录下的文件 不能SSH登陆,其它命令不能执行   机制: SSH登陆成功后,scponly会接管SHELL,并 ...

  6. 将单词首字母大写的JS脚本工具

    <html> <head> <title>首字母全改为大写JS脚</title> <SCRIPT LANGUAGE="JavaScrip ...

  7. 浅解ARC中的 __bridge、__bridge_retained和__bridge_transfer

    文章来源:http://www.outflush.com/2015/03/introduction-of-arc-bridge-type-transfer/ 在对 bridge 相关的修饰符解说前.首 ...

  8. [C++]指针浅析

    Date: 2014-1-4 summary: 指针的简单理解,概念性的东西会比较多(100个人有100种理解,此处只代表我个人看法) Contents: 1.什么是指针 c++ primer plu ...

  9. Android开发之Sqlite的使用

    在Android中存储数据可以用文件.数据库.网络,其中文件和数据库是最常用的,数据库我们常用的就是Sqlite,它是一种经量级的.嵌入式的关系型数据库:在android中当需要操作SQLite数据库 ...

  10. bootstrap css选择不同的宽度

    刚开始使用bootstrap css开源项目.遇到一个问题,默认的input 宽度太大,需要找小一点的. 其实只需要在input tag中选用预定义的较小的宽度即可.比如: <input typ ...