app:srcCompat - Vector drawable shows up in design preview, but doesn't show up in app

我怕爱的太早我们不能终老 提交于 2019-12-01 18:09:27

Insert this line vectorDrawables.useSupportLibrary = true into your build.graddle file as part of the defaultConfig statement. I've used the descriptions that are provided here and it works. Think you have to be aware that config looks different for Gradle 2.0+ and Gradle 1.5.

Regardless of the Gradle version you're using, you have to ensure that that your activity has to extend AppCompatActivity to provide vector support.

I found this answer when I have your problem. Quick answer is you should use android.support.v7.widget.AppCompatImageView and app:srcCompat

this link explain it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!