is it possible multiline with input type as number in Android Edittext?

后端 未结 2 1992
一向
一向 2021-01-06 01:00

When the android edittext input type is number, is it possible to make multilines? I have tried with the following in xml file.

android:inputType=\"number|textMultiL

2条回答
  •  长发绾君心
    2021-01-06 01:03

    I tried each and every solution for your problem.The thing is that when you try to use android:inputType attribute with number android doesnot provide textMultiLine feature for users.it is possible with only one attribute i.e., android:numeric="integer".I know that it is Deprecated but for your problem this is the only solution.

    I have made a sample xml file.it is as follows:

    
    
    
        
    
        
    
        
    
    
    

    There are sample EditText used with explanation as follows:-

    The first one describes the TextView be exactly this many lines tall by using the attribute-android:lines="10".Here if you donot provide android:gravity="top" then any input you do will start from the center of the EditText.

    The second one describes the TextView be at most this many lines tall by using the attribute-android:maxLines="10".

    I hope you will finally be happy for your problem being solved successfully.

提交回复
热议问题