Coil 在 Android 4.4 中无法处理大图像
Coil is not working with big images in Android 4.4
当我使用 Coil Library 时,我测试了 Android 的旧版本并尝试打开正在使用 Coil 库的页面。它显示了空图像。然后我尝试了不同类型的图像(300x300、500x300 等),毕竟我发现如果图像大于 900x350,则它不会在 Coil Library 中显示。我用 Glide Library 测试了相同的场景,它显示一切正常。那么有没有办法解决这个问题,这似乎是图书馆的一个错误?
这是我的线圈代码:
viewHolder.image.load(imageUrl) {
crossfade(750)
scale(Scale.FILL)
}
这是 Glide 代码,一切正常:
val options = RequestOptions()
.centerCrop()
.error(R.drawable.img_placeholder)
Glide.with(activity)
.load(imageUrl)
.apply(options)
.into(viewHolder.image)
但是我不想使用Glide,因为我必须安装Glide只是为了这个问题似乎不对。
编辑:我发现了一些与我的问题类似的东西,但我不知道他们是如何解决这个问题的comment
编辑(2):线圈版本:io.coil-kt:coil:0.11.0
所以我问了线圈开发人员,得到了什么:
Using DebugLogger I was able to see this error in the logs: java.net.ConnectException: Failed to connect to www.giveacare.com.au/xyz:443. This means the device was unable to connect to the server - likely because it only supports TLS 1.2+, which Android 4.x does not. Closing this as it is not a bug with Coil.
好像是Android4.x的版本不支持加载大图
当我使用 Coil Library 时,我测试了 Android 的旧版本并尝试打开正在使用 Coil 库的页面。它显示了空图像。然后我尝试了不同类型的图像(300x300、500x300 等),毕竟我发现如果图像大于 900x350,则它不会在 Coil Library 中显示。我用 Glide Library 测试了相同的场景,它显示一切正常。那么有没有办法解决这个问题,这似乎是图书馆的一个错误?
这是我的线圈代码:
viewHolder.image.load(imageUrl) {
crossfade(750)
scale(Scale.FILL)
}
这是 Glide 代码,一切正常:
val options = RequestOptions()
.centerCrop()
.error(R.drawable.img_placeholder)
Glide.with(activity)
.load(imageUrl)
.apply(options)
.into(viewHolder.image)
但是我不想使用Glide,因为我必须安装Glide只是为了这个问题似乎不对。
编辑:我发现了一些与我的问题类似的东西,但我不知道他们是如何解决这个问题的comment
编辑(2):线圈版本:io.coil-kt:coil:0.11.0
所以我问了线圈开发人员,得到了什么:
Using DebugLogger I was able to see this error in the logs: java.net.ConnectException: Failed to connect to www.giveacare.com.au/xyz:443. This means the device was unable to connect to the server - likely because it only supports TLS 1.2+, which Android 4.x does not. Closing this as it is not a bug with Coil.
好像是Android4.x的版本不支持加载大图