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

 
原因:
EditText需要指定默认输入类型。
 
解决办法:添加android:inputType属性或者android:hint属性。
 
hint属性表示EditText的默认文本;
inputType表示EditText的值类型;

android:inputType参数类型说明:

android:inputType="none"--输入普通字符

android:inputType="text"--输入普通字符

android:inputType="textCapCharacters"--输入普通字符

android:inputType="textCapWords"--单词首字母大小

android:inputType="textCapSentences"--仅第一个字母大小

android:inputType="textAutoCorrect"--前两个自动完成

android:inputType="textAutoComplete"--前两个自动完成

android:inputType="textMultiLine"--多行输入

android:inputType="textImeMultiLine"--输入法多行(不一定支持)

android:inputType="textNoSuggestions"--不提示

android:inputType="textUri"--URI格式

android:inputType="textEmailAddress"--电子邮件地址格式

android:inputType="textEmailSubject"--邮件主题格式

android:inputType="textShortMessage"--短消息格式

android:inputType="textLongMessage"--长消息格式

android:inputType="textPersonName"--人名格式

android:inputType="textPostalAddress"--邮政格式

android:inputType="textPassword"--密码格式

android:inputType="textVisiblePassword"--密码可见格式

android:inputType="textWebEditText"--作为网页表单的文本格式

android:inputType="textFilter"--文本筛选格式

android:inputType="textPhonetic"--拼音输入格式

android:inputType="number"--数字格式

android:inputType="numberSigned"--有符号数字格式

android:inputType="numberDecimal"--可以带小数点的浮点格式

android:inputType="phone"--拨号键盘

android:inputType="datetime"

android:inputType="date"--日期键盘

android:inputType="time"--时间键盘

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

  1. <EditText /> This text field does not specify an inputType or a hint

    我是一个警告,xml代码是: <EditText android:id="@+id/str_ipaddress" android:layout_width="wra ...

  2. 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 ...

  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. Struts2 源码分析——调结者(Dispatcher)之执行action

    章节简言 上一章笔者写关于Dispatcher类如何处理接受来的request请求.当然读者们也知道他并非正真的执行action操作.他只是在执行action操作之前的准备工作.那么谁才是正真的执行a ...

  2. Effective java笔记(五),枚举和注解

    30.用enum代替int常量 枚举类型是指由一组固定的常量组成合法值的类型.在java没有引入枚举类型前,表示枚举类型的常用方法是声明一组不同的int常量,每个类型成员一个常量,这种方法称作int枚 ...

  3. c# 连接Mysql数据库

    mysql.data.dll下载_c#连接mysql必要插件 全部版本下载:http://hovertree.com/h/bjaf/0sft36s9.htm mysql.data.dll是C#操作MY ...

  4. 无法解决 equal to 操作中 "SQL_Latin1_General_CP1_CI_AS" 和 "Chinese_PRC_CI_AS"

    无法解决 equal to 操作中 "SQL_Latin1_General_CP1_CI_AS" 和 "Chinese_PRC_CI_AS" 之间 2011-0 ...

  5. ul li设置横排,并除去li前的圆点

    效果预览:http://hovertree.com/texiao/css/ 如何用CSS制作横向菜单 让ul li横向排列及圆点处理 我们先建立一个无序列表,来建立菜单的结构.代码是: <ul& ...

  6. TableLayoutPanel导致的闪屏问题

    界面Load的时候添加对tableLayoutPanel的处理即可,还可设置窗体的DoubleBuffered属性为True tableLayoutPanel1.GetType().GetProper ...

  7. sql 中的Bulk和C# 中的SqlBulkCopy批量插入数据 ( 回顾 and 粗谈 )

    通常,我们会对于一个文本文件数据导入到数据库中,不多说,上代码. 首先,表结构如下.   其次,在我当前D盘中有个文本文件名为2.txt的文件. 在数据库中,可以这样通过一句代码插入. Bulk in ...

  8. thinkphp学习简易教程(二) thinkphp连接读取MySQL数据库

    首先, 在本地服务器中新建项目APP,依据第一讲中的步骤配置好thinkphp,这里为了测试方便,不分前台和后台模块,统一把模块路径设为'./APP/'. 1.新建数据库myapp,以及数据库表thi ...

  9. HTML、CSS、JavaScript和PHP的注释

  10. 【webapp的优化整理】要做移动前端优化的朋友进来看看吧

    单页or多页 本文仅代表个人观点,不足请见谅,欢迎赐教. webapp 小钗从事单页相关的开发一年有余,期间无比的推崇webapp的网站模式,也整理了很多移动开发的知识点,但是现在回过头来看,weba ...