天天看点

【TIP_3】在代码中获取attribute值的方法

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

TypedArray ta = mContext.obtainStyledAttributes(attrs);

Drawable drawableFromTheme = ta.getDrawable(0);

ta.recycle();