Multiline text Edit text and fill the first letter in the text editor

Hello, I'm trying to make an EditText for a multi-line string, and the first letter should be of type in capital, which I use with android:inputType="textCapSentences" , but after setting the input type to textCapSentences it sets the first letter in the capital, but EditText - only one line. Can you please help me make an EditText for multi-line plus the first letter should be a capital type

Here is the current EditText

 <EditText android:id="@+id/commentsEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/view_vertical_margin" android:background="@android:drawable/editbox_background" android:inputType="textCapSentences" android:gravity="top" android:hint="@string/comments" android:lines="5" /> 
+9
source share
4 answers

Have you tried the below code: -

 <EditText android:id="@+id/commentsEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:drawable/editbox_background" android:inputType="textCapSentences|textMultiLine" android:gravity="top" android:hint="@string/comments" android:lines="5" /> 
+29
source

Try setting the EditText input type as shown below:

 android:inputType="textCapSentences|textMultiLine" 
+2
source
 <EditText android:id="@+id/commentsEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/view_vertical_margin" android:background="@android:drawable/editbox_background" android:inputType="textCapSentences" android:gravity="top" android:hint="@string/comments" android:lines="5" android:singleLine="false" /> 
0
source

using edittext.setRawInputType (InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);

and in xml android: inputType = "textMultiLine"

0
source

All Articles