2012-12-12 50 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'鍵顯示。 –

相關問題