首页 电子书:Android文本框中的输入法控制(PDF文档)

电子书:Android文本框中的输入法控制(PDF文档)

举报
开通vip

电子书:Android文本框中的输入法控制(PDF文档) WWW.CNMSDN.COM This document is downloaded from Share.cnmsdn.com Created By luokelong Android 文本框中的输入法控制 【提示:请尽量使用 Adobe reader 阅读本文档】 下载更多相关源代码、电子书、工具包请访问:http://share.cnmsdn.com/ 我分享的更多移动开发资源:http://share.cnmsdn.com/user/luokelong 在Android开发中,必不可少的会使用到...

电子书:Android文本框中的输入法控制(PDF文档)
WWW.CNMSDN.COM This document is downloaded from Share.cnmsdn.com Created By luokelong Android 文本框中的输入法控制 【提示:请尽量使用 Adobe reader 阅读本文档】 下载更多相关源代码、电子书、工具包请访问:http://share.cnmsdn.com/ 我分享的更多移动开发资源:http://share.cnmsdn.com/user/luokelong 在Android开发中,必不可少的会使用到文本框(EditText)来进行数据录入,也就会需要对输入法进行一些控制。本文 会对输入法的控制进行一些 总结 初级经济法重点总结下载党员个人总结TXt高中句型全总结.doc高中句型全总结.doc理论力学知识点总结pdf 。 文本框的输入法控制 先看下LAYOUT定义文件中的和输入法有关的属性: 属性名说明 android:inputMethod已被弃用,改为使用inputType android:inputType指定输入法的类型,int类型,可以用|选择多个。取值可以参考:android.text.InputType类。取值包括 :text, textUri, phone,number,等。 android:imeOptions指定输入法窗口中的回车键的功能,可选值为normal, actionNext,actionDone,actionSearch等。部分输入法对此的支持可能不够好。 下面的LAYOUT定义文件举了一些例子说明inputType和imeOptions的使用。 < EditText android:id="@+id/textNormal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Normal text" android:inputType="text" android:imeOptions="actionNext" /> < EditText android:id="@+id/textInteger" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Integer only" android:inputType="number" android:imeOptions="actionNext" /> < EditText android:id="@+id/textDecimal" 1 / 4 WWW.CNMSDN.COM This document is downloaded from Share.cnmsdn.com Created By luokelong android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Decimal only" android:inputType="numberDecimal" android:imeOptions="actionNext" /> < EditText android:id="@+id/textPhone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Phone number" android:inputType="phone" android:imeOptions="actionNext" /> < EditText android:id="@+id/textEmail" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Email" android:imeOptions="actionSend" android:inputType="textEmailAddress" /> < EditText android:id="@+id/textSite" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Web Site" android:imeOptions="actionDone" android:inputType="textUri" /> 在模拟器中的表现如下: 普通文本数字,整型 2 / 4 WWW.CNMSDN.COM This document is downloaded from Share.cnmsdn.com Created By luokelong 3 / 4 WWW.CNMSDN.COM This document is downloaded from Share.cnmsdn.com Created By luokelong 可看到,随着inputType的不同,输入法的键盘也自动跟着发生变化,并且在inputType=number时,是不允许输入英文 字符的。 注意:android:phoneNumber,android:numeric,这几个属性均已被废弃,不少输入法已经不再支持。直接使用inputTy pe比较好。 另外,在做这种调试时,最好使用Google拼音,或Android键盘来进行,否则imeOptions可能不能政党显示,比如百度 输入法在我删除它之前就一直不支持imeOptions。 下载更多相关源代码、电子书、工具包请访问:http://share.cnmsdn.com/ 我分享的更多移动开发资源:http://share.cnmsdn.com/user/luokelong Powered by TCPDF (www.tcpdf.org) 4 / 4
本文档为【电子书:Android文本框中的输入法控制(PDF文档)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_966711
暂无简介~
格式:pdf
大小:136KB
软件:PDF阅读器
页数:0
分类:互联网
上传时间:2011-04-16
浏览量:32