Android defstyle parameter

后端 未结 3 2014
别那么骄傲
别那么骄傲 2021-02-18 19:50

All the classes in Android that can be built using XML have constructors of the form:

Context context, AttributeSet attrs, int defStyle

What is

3条回答
  •  难免孤独
    2021-02-18 20:26

    All Views supply this constructor, so every subclass can use its own base style when inflating.

    For the param, I'd like to quote the docs for the View-Class:

    defStyle The default style to apply to this view. If 0, no style will be applied (beyond what is included in the theme). This may either be an attribute resource, whose value will be retrieved from the current theme, or an explicit style resource.

提交回复
热议问题