Android Calculator - Editview cannot input decimal places

前端 未结 4 1992
醉话见心
醉话见心 2021-01-24 10:56

I am new to Android code development...I am developing a Android calculator apps and does not understand why the two EditTexts (first input and second input) cannot accept decim

4条回答
  •  误落风尘
    2021-01-24 11:45

    If you want to use Decimal Number only on your EditText

    use the xml attribute android:inputType="numberDecimal" in your EditText widget your EditText declaration will be like this:

    
    

    If you want to use Signed Decimal Number than combine the two Xml attributes android:inputType="numberDecimal" and android:inputType="numberSigned". Your EditText declaration will be like this:

    
    
    
    

提交回复
热议问题