iOS-Safari-图像无法完全呈现/被截断 [英] iOS - Safari - images not rendering fully / cut off
问题描述
我们通过Ajax请求将图像加载到弹出窗口中,并且它们只是间歇性地部分渲染.
We are loading images in a popup, via an Ajax request, and they intermittently only partially render.
除了核心流程之外,我基本上已经删除了所有怪异的Javascript/废话-仅是基本的HTML图像,并且仍在发生-仅在iOS上.
I've basically removed any weird Javascript/nonsense other than the core flow - just a basic HTML image, and it is still happening - only on iOS.
旋转"设备后,图像可以正确呈现-因此,它不是漂浮在上面的怪异div或其他任何东西(连接到Mac后,我可以在iOS调试器模式下选择图像)
Once you 'rotate' the device, the image renders correctly - so, it's not a weird div floating above or anything (I can select the image in iOS debugger mode when attached to a Mac)
任何帮助将不胜感激.
推荐答案
似乎这是iOS图像解码器中的一个问题-某种竞争条件.
It seems this is an issue within the iOS image decoder - some kind of race condition.
已通过强制解码器使用以下命令在主线程上进行操作来解决此问题:
This has been fixed by forcing the decoder to operate on the main thread, using:
<img decoding="sync" src="@Url" />
希望这对其他人有帮助!
Hopefully this helps someone else!
这篇关于iOS-Safari-图像无法完全呈现/被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!