2012-12-12 52 views
0

我想输入EditText som字符: android:digits =“1234567890 -_ @#”。 如果我没有设置inputType键盘输入文本是默认的。如何在Edittext中显示默认键盘编号?

我想显示数字键盘显示默认。 但是:

如果EditText上的设计,我设置:

android:inputType="number" 

android:inputType="phone" 

EditText上不显示键(@ _) 如何显示默认的键盘号(允许输入digits="[email protected]#.")在Edittext?

+0

inputtype'number'不包含'_ @#' –

+0

尝试使用InputFilter http://stackoverflow.com/questions/7926896/android-want-to-restrict-some-charaters-to-the-edittext –

+0

包含#,不包含@,_ – mum

回答

2

使用此: “1234567890 @ -_#”

 <EditText 
      android:id="@+id/ed1" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="" 
      android:inputType="number" 
      android:digits="[email protected]#."/> 

它为我,让我插入这个字符只要。

希望这会帮助你。

谢谢。

+0

android:inputType =“number”不包含@和_ – mum

+0

它显示在我的设备键盘上。我有4.0操作系统的HTC。你有哪些设备? –

+0

在我的模拟器2.2上,我可以看到键盘上除_以外的所有按键。但是我可以用'ALT'键显示。 –

相关问题