想问问。从资源中使用VectorDrawable的正确方法是什么?使用支持库compile 'com.android.support:support-v4:25.1.1'
因为不推荐使用getDrawable(),所以当我使用ContextCompat.getDrawable(this, R.drawable.ic_cancel_button);
设置工具栏导航图像时,如下所示
if(toolbar != null)
{
toolbar.setNavigationIcon(ContextCompat.getDrawable(this, R.drawable.ic_cancel_button));
}
发生了错误。
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_cancel_button.xml from drawable resource ID #0x7f02005e
发布于 2017-02-18 16:10:12
https://stackoverflow.com/questions/42317465
复制相似问题