Use declare styleable to set custom component input type

前端 未结 4 578
耶瑟儿~
耶瑟儿~ 2020-12-14 06:18

I have a CompositeComponent (EditText+ImageButton) When clicking on button the edittext content will be cleared. It is working fine. My problem is setting attributes to my c

4条回答
  •  星月不相逢
    2020-12-14 06:35

    I managed to do it with raw int value: I think it is not good practice. I can assign raw values like this: cet:InputType="2"

    2 for number (Referred for values: http://developer.android.com/reference/android/text/InputType.html#TYPE_CLASS_NUMBER and http://developer.android.com/reference/android/R.styleable.html#TextView_inputType)

    I believe can help but don't know how to use it.

提交回复
热议问题