Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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" and then setRawInputType(Configuration.KEYBOARD_12KEY). However, this does not work when editing the edittext in horizontal orientation and it also does not show the slash (/) which I need to input fractions. If I set the input type tosetRawInputType(InputType.TYPE_CLASS_NUMBER), it also does not work in horizontal orientation and always after I enter a space, it switches to the normal input keyboard. Do you know any solution which would help me?

like image 211
benestar Avatar asked Oct 11 '25 19:10

benestar


1 Answers

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" />
like image 70
Oleksandr B Avatar answered Oct 14 '25 13:10

Oleksandr B