Is it possible to load a drawable from the assets folder?

后端 未结 8 1648
刺人心
刺人心 2020-12-08 06:43

Can you load a drawable from a sub directory in the assets (not the drawable folder) folder?

8条回答
  •  感情败类
    2020-12-08 07:01

    I recommend to use this

     Drawable.createFromResourceStream(resources,new TypedValue(), resources.getAssets().open(filename), null)
    

    which returns properly scaled drawable thanks to resources ...

提交回复
热议问题