fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Fresco can not load local xxx.gif resource

Open sunfusheng opened this issue 10 years ago • 5 comments

Hi: My name is SunFusheng. I want to load local xxx.gif, but fresco can not. Can it support?

sunfusheng avatar Dec 05 '15 05:12 sunfusheng

Yes, Fresco does support GIF images. In order to determine why your GIF fails to load we are going to need more information. If you can share the GIF image that would be the easiest way.

plamenko avatar Dec 05 '15 23:12 plamenko

The following code: Uri uri = Uri.parse("android.resource://" + getActivity().getPackageName() + "/" + R.drawable.mygif); DraweeController controller = Fresco.newDraweeControllerBuilder() .setUri(uri) .setAutoPlayAnimations(true) .build(); sdvGif.setController(controller); I put mygif in drawable dir. it does not work.

sunfusheng avatar Dec 07 '15 02:12 sunfusheng

Any chance you can upload that GIF file so we can try it ourselves? Have you followed the troubleshooting steps?

plamenko avatar Dec 08 '15 12:12 plamenko

gif_robot_walk I try it again! Thank you!

sunfusheng avatar Dec 09 '15 01:12 sunfusheng

I solved the problem by modifing following code: Uri uri = Uri.parse("res://" + getActivity().getPackageName() + "/" + R.drawable.mygif); Thanks very much!

sunfusheng avatar Dec 09 '15 01:12 sunfusheng