如何在android中同时使用多行和initcap制作edittext

如何在android中同时使用多行和initcap制作edittext,android,android-edittext,Android,Android Edittext,我发现,android:inputType和添加“textmiline”和“textcap句”分别使输入文本多行和init cap,但我们如何将两者协作到一个编辑文本? 因为当我将两个android:inputType放在一个edittext中时会显示错误 <EditText android:id="@+id/editText3" android:layout_width="wrap_content" android:layout_height="wrap_cont

我发现,
android:inputType
和添加
“textmiline”
“textcap句”
分别使输入文本多行和init cap,但我们如何将两者协作到一个编辑文本? 因为当我将两个
android:inputType
放在一个edittext中时会显示错误

<EditText
    android:id="@+id/editText3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/textView4"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/textView4"
    android:layout_marginTop="28dp"
    android:inputType="textCapSentences"
    android:ems="10"
    android:inputType="textMultiLine" />  // cannot add this here
:-(

像这样使用

android:inputType="textCapSentences|textMultiLine" 
在代码中

<EditText
    android:id="@+id/editText3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/textView4"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/textView4"
    android:layout_marginTop="28dp"
    android:inputType="textCapSentences|textMultiLine" 
    android:ems="10"/>

像这样使用

android:inputType="textCapSentences|textMultiLine" 
在代码中

<EditText
    android:id="@+id/editText3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/textView4"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/textView4"
    android:layout_marginTop="28dp"
    android:inputType="textCapSentences|textMultiLine" 
    android:ems="10"/>

inputType属性(textcap句)依赖于输入法

您可以通过添加以下行来实现您的要求:

android:inputType="textCapSentences|textMultiLine" 
在一些键盘上,它仍然无法工作。我也使用过它,它在几乎所有的键盘(Nexus、Samsung、HTC)上都能工作,但在摩托罗拉却不行。

inputType属性(textcap句)依赖于时间

您可以通过添加以下行来实现您的要求:

android:inputType="textCapSentences|textMultiLine" 

在一些键盘上,它仍然不起作用。我也使用过它,它在几乎所有的键盘(Nexus、Samsung、HTC)上都起作用,但在Motorola上却不起作用。

多行可以起作用,但init cap在这个edittext和以android:inputType=“TextCapSequences”编写的edittext中都不起作用。:-(我的意思是,它在移动设备中工作,但在emulator中,我认为它使用键盘输入类型,如果capslock在大写字母中打开,如果关闭,它的小写字母多行正在工作,但init cap在这个edittext和写为
android:inputType=“textcapQuences”
的文本中都不工作:-(我的意思是它在移动设备中工作,但在emulator中我认为它使用键盘输入类型,如果capslock在大写字母中打开,如果关闭,它的小写字母我的意思是它在移动设备中工作,但在emulator中我认为它使用键盘输入类型,如果capslock在大写字母中打开,如果关闭,它的小写字母我的意思是它在移动设备中工作,但在emulator i中想想它使用的是键盘输入类型,如果capslock是在大写字母中打开的,如果是关闭的,它就很小letter@Mukund:在哪个设备上测试?@Mukund:在哪个设备上测试?