搜索
您的当前位置:首页正文

Context#getResources().getDrawab

来源:知库网

1)使用drawable资源但不为其设置theme主题

ResourcesCompat.getDrawable(getResources(), R.drawable.name, null);

2)使用默认的activity主题

ContextCompat.getDrawable(getActivity(), R.drawable.name);

3)使用自定义主题

ResourcesCompat.getDrawable(getResources(), R.drawable.name, anotherTheme);
Top