iOS - Safari - images not rendering fully / cut off

匆匆过客 提交于 2021-01-29 12:30:18

问题


We are loading images in a popup, via an Ajax request, and they intermittently only partially render.

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.

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)

Any help would be most appreciated.


回答1:


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!




回答2:


In my case, the solution was to decrease the size of the images I was displaying. Our images were about 10x the size of the HTML element they were displayed in.

Apple's developer document states:



来源:https://stackoverflow.com/questions/58323768/ios-safari-images-not-rendering-fully-cut-off

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!