草庐IT

defStyleRes

全部标签

android - context.obtainStyledAttributes() 中的 defStyleAttr 和 defStyleRes 有什么用?

当我检查FrameLayout中的QuickContactBadge时,我发现了以下代码:publicQuickContactBadge(Contextcontext,AttributeSetattrs,intdefStyle){super(context,attrs,defStyle);TypedArraya=context.obtainStyledAttributes(attrs,com.android.internal.R.styleable.QuickContactBadge,defStyle,0);mMode=a.getInt(com.android.internal.R.s