how to set input type to be numberdecimal but also allow a “-”

后端 未结 5 1881
孤城傲影
孤城傲影 2021-02-13 15:26

I have set input type to be numberdecimal but also want to populate the editText with a \"-\" programmatically. I can add the text but then I am unable to edit the text as it do

5条回答
  •  自闭症患者
    2021-02-13 16:01

    I managed to do that with:

    android:inputType="number|numberSigned"    
    android:digits="0123456789-"
    

提交回复
热议问题