Support library VectorDrawable Resources$NotFoundException

前端 未结 14 1330
你的背包
你的背包 2020-11-29 18:40

I am using Design Support Library version 23.4.0. I have enabled the gradle flag:

defaultConfig {
    vectorDrawables.useSupportLibrary = tr         


        
14条回答
  •  無奈伤痛
    2020-11-29 18:59

    We had the same issue. Vector drawables were not visible on Kitkat. I solved this issue by adding AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); to the onCreate method of Activities.

    Before that dont forget to add:

    defaultConfig {
        vectorDrawables.useSupportLibrary = true
    }
    

    and call setImageResource for the view that you use the vector drawable. My view is ImageButton. I have Android SDK build tools version 23.0.3

提交回复
热议问题