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

Che*_*eng 30 android

我试过了

        <EditText
            android:id="@+id/editText1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="textPersonName" >
Run Code Online (Sandbox Code Playgroud)

我意识到它可以接受任何角色.那么,android:inputType="textPersonName"与没有它相比,有什么特别之处呢?

ang*_*cat 33

区别在于,如果使用"textPersonName",则用户无法插入新行(不显示输入按钮)


Jil*_*son 9

使用时不会进行拼写检查,android:inputType="textPersonName"但已在中完成textCapWords

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

因此,最好的解决方案是将或结合在一起 android:inputType="textPersonName|textCapWords"

现在名称将不会有红色下划线,首字母也将大写