Android Web 浏览器缩放对于图像比精灵更有效

发布于 2024-09-28 01:24:26 字数 322 浏览 2 评论 0原文

我正在开发一个移动 Web 应用程序,并且我有一个主屏幕,上面有许多图标,因此我尝试使用精灵一次性提供所有图像。

然而,我注意到 iphone4 很好地缩放了精灵中的图像(它们看起来有点抖动),但在我的 HTC Evo 上,精灵渲染的图像看起来确实是块状的。我切换到标准图像(背景:(/image_url/)无背景位置)并且图像看起来好多了 - 请参阅此 “屏幕截图”,其中左侧图像使用单个图像提供,右侧图像由精灵提供(但与精灵中的图像相同)。

有没有办法让 Android 浏览器更好地解释精灵?

I'm developing a mobile web application and I have a home screen with a number of icons on it, so I tried to use a sprite to serve all the images in one swoop.

I noticed, however, that the iphone4 scaled the images in my sprite fairly well (they looked a little dithered), but on my HTC Evo the sprite rendered images look really blocky. I switched to standard images (background:(/image_url/) w/o background-position) and the image looked much better - see this screen shot, where the left image is served using the single image, and the ones to the right of it are served from the sprite (but are the same images in the sprite).

Is there a way to get the Android browser to interpret the sprites better?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

看轻我的陪伴 2024-10-05 01:24:26

您遇到了 Android 浏览器中的最大解码图像大小障碍。这个大小限制在 2.3 中被提高到合理的水平。尝试将精灵分割成更小的图像。

You're hitting the maximum decoded image size barrier in the Android browser. This size limit was upped to something reasonable in 2.3. Try splitting up your sprites into smaller images.

沫尐诺 2024-10-05 01:24:26

这只是一个猜测,但是,您使用的是哪一个?您的运营商或 wifi 连接?一些操作员确实将图像压缩到一定大小。

This is just a guess but, which one are you using? Your operator or wifi connection? Some operators do compress images over certain size.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文