android的有什么特别之处:EditText的inputType =“textPersonName”

时间:2012-07-31 01:34:21

标签: android

我试过

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

我意识到它可以接受任何角色。那么,与不拥有android:inputType="textPersonName"相比,有什么特别的呢?

3 个答案:

答案 0 :(得分:32)

不同之处在于,如果您使用“textPersonName”,则用户无法插入新行(不显示输入按钮)

答案 1 :(得分:4)

使用android:inputType="textPersonName"时未执行拼写检查,但已在textCapWords中完成。

因此,如果你使用textPersonName,那么名字不会是红色下划线,但每个名字的首字母(名字,中间名,姓氏等)都不会被大写。

所以最好的解决方案是将两者结合使用或 那是android:inputType="textPersonName|textCapWords"

现在名字不会显示红色下划线,第一个字母也会被大写

答案 2 :(得分:0)

我在Android 5.0.1上测试,我插入了一个带有&#34; textPersonName&#34;的编辑文本。输入类型和其他edittext与&#34; text&#34;输入类型,在两个示例中,未显示输入按钮。我真的没有看到这些输入类型之间的差异。

问候