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

后端 未结 5 1867
孤城傲影
孤城傲影 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 15:55

    You will have to write your own KeyListener. You could start by downloading the source of the NumberKeyListener and take it from there.

    Martin

提交回复
热议问题