我正在使用 Fresco 通过 uri 将手机存储中的图像加载到 SimpleDraweeView 中(内部和外部,使用内容提供程序 - 'content://')。它们加载良好,但如果它们的属性中设置了方向,则继续旋转。我尝试使用 .setAutoRotateEnabled(true) 属性设置 imageRequest,但由于某种原因它对我不起作用。关于如何旋转图像以正确显示它们有什么建议吗?
imageView.setController(
controllerBuilder
.setOldController(imageView.getController())
.setImageRequest(imageRequestBuilder
.setSource(uri)
.setAutoRotateEnabled(true)
.setResizeOptions(null)
.build())
.build());
最佳答案
我通过设置 .setDownsampleEnabled(false) 解决了这个问题。我不知道为什么,但我想下采样确实是实验性的,并且可以防止自动旋转的发生。
关于Android:如何使用 Fresco 旋转图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34514161/