getResources().getDrawable()方法过时后的替代方法
2017-09-12 10:44
417 查看
博客源址:http://www.jianshu.com/p/e22d9dd93d4a
参考:Android getResources().getDrawable() deprecated API 22
1)使用drawable资源但不为其设置theme主题
2)使用默认的activity主题
3)使用自定义主题
参考:Android getResources().getDrawable() deprecated API 22
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);
相关文章推荐
- getResources().getDrawable()方法过时的替代方法
- Context#getResources().getDrawable()方法过时后的替代方法
- getDrawable过时的替代方法
- getDrawable()方法过时 替代
- getDrawable过时替代方法
- Android中getResources().getDrawable() 过时的解决方法
- getDrawable过时的替代方法
- getDrawable,getColor 过时的替代方法
- Context#getResources().getDrawable()方法过时后的替代方法
- 好用的 Android getDrawable过时的替代方法
- getDrawable,getColor 过时的替代方法
- getDrawable过时的替代方法
- getDrawable过时的替代方法
- getDrawable过时的替代方法
- Android中getResources().getDrawable() 过时的解决方法
- Android中getDrawable和getColor过时的替代方法
- getDrawable()getColor()和方法过时的替代方法
- getResource().getDrawable() 方法过时替代方法
- (转)getDrawable过时的替代方法
- Android的getColor,getDrawable过时的替代方法