How can I create my custom properties on xml for Android?

前端 未结 4 603
死守一世寂寞
死守一世寂寞 2020-12-04 17:59

We have in our project a keyboard with \"Key\" elements, this Key elements have attributes such as android:codes=\"119\", android:keyLabel=\"w\" and so on.

My questi

4条回答
  •  没有蜡笔的小新
    2020-12-04 18:24

    You can create custom attributes for your own classes that extend View or a subclass. The process is documented in the "Creating a View Class" section of the Android Dev Guide under the heading "Define Custom Attributes":

    https://developer.android.com/training/custom-views/create-view#customattr

提交回复
热议问题