How to play gif with Fresco

阅读更多
原文地址: https://stackoverflow.com/a/34892610

Put your gif in res/raw folder.
In this example res/raw/splash.gif
ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithResourceId(R.raw.splash).build();
SimpleDraweeView draweeView = new SimpleDraweeView(this);
DraweeController controller = Fresco.newDraweeControllerBuilder()
    .setUri(imageRequest.getSourceUri())
    .setAutoPlayAnimations(true)
    .build();
draweeView.setController(controller);

你可能感兴趣的:(android,fresco,gif)