Android的defstyle参数 [英] Android defstyle parameter
问题描述
所有的类在Android中,可以使用XML构建具有以下形式的构造:
All the classes in Android that can be built using XML have constructors of the form:
Context context, AttributeSet attrs, int defStyle
什么是 defstyle
参数?
推荐答案
所有视图提供此构造,所以每个子类可以充气的时候使用它自己的基本样式。
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 的默认样式申请 这一观点。如果为0,没有风格会 应用(超出包含在 主题)。这可以是一个 属性的资源,其价值会 从当前主题检索 或明确的样式资源。
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.
这篇关于Android的defstyle参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!