int backGround = attrs.getAttributeResourceValue(ANDROIDXML, "background", -1);
StateListDrawable drawable = (StateListDrawable) mContext.getResources().getDrawable(backGround);
DrawableContainerState dcs = (DrawableContainerState) drawable.getConstantState();
Drawable[] children = dcs.getChildren();
children 数组里面是statelistdrawable里的各个状态的drawable,但是这个数字会大于真正设置的drawable的个数。