iOS Safari图像渲染问题 [英] iOS Safari image rendering issue

查看:298
本文介绍了iOS Safari图像渲染问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iPad上的Safari中遇到过一些非常奇怪的行为。

I've been experiencing some very strange behavior in Safari on iPad.

有一个大的图像被重新调整,并且方向改变了位置。这可能不是重点,但它在肖像方面很好,在风景中破碎。以下是它的破坏方式:

There's a large image that gets rescaled and position on orientation change. This is probably beside the point, but it's fine in portrait and "broken" in landscape. Here's how it's broken:

有一条大条纹横向穿过它。应用一些CSS,我可以看到我实际上是通过条纹查看容器元素(通常大约40像素高,并在图像上水平运行)。

There's a large stripe running horizontally through it. Applying some CSS, I can see that I'm actually looking at the container element through the stripe (usually about 40 pixels high, and running horizontally across the image).

为了让它更加令人费解,这就是当我尝试通过将代码连接到桌面并使用桌面Safari的Web检查器来检查代码时发生的情况:我检查元素或者甚至是附近的元素,图像也能正确呈现,就好像某些事件已在iPad上被触发一样。很奇怪。

To make it even more baffling, here's what happens when I try to inspect the code by hooking it up to a desktop and using desktop Safari's web inspector: I inspect the element or even a nearby element and the image renders correctly, as if some event has been fired on the iPad. Weird.

此外,在我只是触摸页面后,图像通常会正确呈现,而不是(据我所知)触发我的JS正在侦听的事件。

Additionally, the image will usually render correctly after I simply touch the page, without (as far as I know) firing an event that my JS is listening for.

哦,这是在我将iOS从6.0更新到6.1之后开始发生的。

Oh and this started happening after I updated iOS from, I think, 6.0 to 6.1.

我' m在iOS 6.1.2上使用Safari 8536.25。

I'm on iOS 6.1.2 with Safari 8536.25.

我完全失去了。任何人都可以指出我在这方面的正确方向吗?

I'm at a complete loss. Can anyone point me in the right direction here?

推荐答案

答案,从这个问题和anwser找到:

And the answer, found from this question and anwser:

iPad Safari滚动导致HTML元素消失并再次出现延迟

*:not(html) {
    -webkit-transform: translate3d(0, 0, 0);
}

我不明白,但它确实有效。

I don't get it, but it works.

这篇关于iOS Safari图像渲染问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆