阅读289 返回首页    go 阿里云 go 技术社区[云栖]


android EditText 设置弹出数字输入法键盘

首先设置只能输入数字:

[html] view plaincopy
  1. <EditText  
  2.     android:id="@+id/edit_digit_input"  
  3.     android:layout_width="wrap_content"  
  4.     android:layout_height="wrap_content"  
  5.     android:digits="1234567890."  
  6.     android:singleLine="true"   
  7.     />  

再者代码里面设置输入法类型:

[java] view plaincopy
  1. editText.setInputType(EditorInfo.TYPE_CLASS_PHONE);  

则如果该EditText获得焦点,会弹出数字输入法的模拟键盘

 

  

最后更新:2017-04-04 07:03:42

  上一篇:go Oracle中的常用权限视图
  下一篇:go 删除文件时排除特定文件