Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只想在 EditText 中编写整数类型,但是当我单击 EditText 时,它会打开普通键盘,但是在执行此操作时我只需要一个带数字的键盘(全部在对话框中)。
谁能告诉我该怎么做?
将此添加到您的edittextxml
edittext
android:inputType="number"
有关更多信息,请参阅此
编辑: 用于以编程方式设置
yourEdittext.setInputType(InputType.TYPE_CLASS_NUMBER);