view 构造方法的调用顺序:
:boom:
public View(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
:boom:
public View(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
:boom:
public View(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
this(context);
...
}
:boom: ####最终都要调用 > View(Context context)
public View(Context context) {
mContext = context;
mResources = context != null ? context.getResources() : null;
mViewFlags = SOUND_EFFECTS_ENABLED | HAPTIC_FEEDBACK_ENABLED;
// Set some flags defaults
mPrivateFlags2 =
(LAYOUT_DIRECTI
...
}