How to show Android keyboard with symbols mode by default?

前端 未结 5 904
余生分开走
余生分开走 2020-12-06 01:55

I have a EditText component, and, of course, if you click on it, the Android keypad is shown, allowing the user to input text. As far as I know, all Android sof

5条回答
  •  [愿得一人]
    2020-12-06 02:31

    I agree it is an InputType. If you want to show only numbers to your user then you would add the following to you xml document for your edit text:

            android:inputType="number"
    

    However if you set it as number then the user has to enter a number. But you can add additional types as well like numbers and email addresses such as:

            android:inputType="number|textEmailAddress"
    

    Check out http://developer.android.com/reference/android/text/InputType.html for more options. You can also check out what eclipse or android studio shows you under "inputType"

提交回复
热议问题