0
I see that to write in only one line on EditText
needs to be with android:maxLines="1"
and android:inputType="text"
, but I wonder if there’s any way to do this with android:inputType="number"
, because I just want the number pad to appear
Example:
<EditText
android:inputType="number"
android:digits="0123456789"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"/>
Only when I do this, when it comes to the end of the line it goes to another line, keeping the size of the layout of a line, and without the android:maxLines="1"
it increases the layout size of the EditText
The way you’re doing it, you’re not crossing a line, that’s correct. However, when the space to put the numbers is gone, they have to go somewhere if you keep typing. Have you tried the possibility to limit the amount of typed characters?
– viana
I understood that part, it’s the right part, but the question is whether there’s any way he behaves the same when it’s
android:inputType="text"
, to stay in the same line and go giving side scroll onEditText
and not on a new line. But I think it is not possible, must have a reason for such a limitation.– O_Vagner