Skip to content Skip to sidebar Skip to footer

Android Multiline Number Edittext

I want to create an EditText in Android which has several lines and number input. It is for the input of a matrix. I already have a solution to set android:inputType='textMultiLine

Solution 1:

In this way could be created multiline EditText which allow only numbers and has digit keyboard

   <EditText

                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:digits="0,1,2,3,4,5,6,7,8,9,/"
                android:inputType="textMultiLine|phone" />

Solution 2:

try it , i use this for edittext with multiline and inputtye phone

   <EditText
            android:id="@+id/txt_mobiles"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:digits="0,1,2,3,4,5,6,7,8,9,\n"
            android:inputType="phone"/>

replace number instead of phone


Solution 3:

Try this

 <EditText 
      android:inputType="textMultiLine" 
      android:digits="0,1,2,3,4,5,6,7,8,9,/" 
      android:hint="Only letters, / allowed"/>

Solution 4:

It will be:

   <EditText
        android:inputType="textMultiLine|number"
        android:singleLine="false" 
        android:digits= "0123456789" />

Not:

   <EditText
        android:inputType="textMultiLine|number"
        android:singleLine="false"
        android:digits= "0,1,2,3,4,5,6,7,8,9" />

If you put comma into digits, then you can take , as input. Like: 12154,454 . Thanks


Solution 5:

Try it, i use this for Edittext with multiline number

android:singleLine="false"
android:digits="0123456789"

Post a Comment for "Android Multiline Number Edittext"