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);

猜你喜欢

转载自yhz61010.iteye.com/blog/2380919
gif