天天看點

【TIP_3】在代碼中擷取attribute值的方法

int[] attrs = new int[]{R.attr.selectableItemBackground};

TypedArray ta = mContext.obtainStyledAttributes(attrs);

Drawable drawableFromTheme = ta.getDrawable(0);

ta.recycle();