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 上设置inputType
<EditText android:inputType="numberDecimal" />
正则表达式应该是这样的:
if(myString.matches('0[1-9]:[0-5][0-9]')){ //String is valid }