我有一个用于 css 背景的精灵表,尺寸为 2000x2000 像素。在所有桌面浏览器中都可以正常工作,但在 iPhone 版 Safari 上则完全不渲染。
将尺寸降低到 1000x1000 可以完美渲染。 (好吧,除了我现在错过了精灵表的四分之三)。
背景图像的尺寸有什么限制吗? 2000x2000 并不是那么大。试图绕过重做大量 css 定位的工作。
另外,我正在对布局使用媒体查询(最大宽度,而不是最大设备宽度)。但我仍然使用相同的图形。
编辑:啊是的,它在 Android 设备上运行得很好。
我们在 iPad 和 iPhone 上也遇到了同样的问题。最安全的选择是使用 1024x1024 像素或更少。最终我们不得不将精灵表分为两部分并再次进行CSS。
根据http://www.glbenchmark.com/ http://www.glbenchmark.com/ and http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/OpenGLESPlatforms/OpenGLESPlatforms.html http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/OpenGLESPlatforms/OpenGLESPlatforms.html
Device Maximum texture size
iPod Touch 1024 x 1024
iPod Touch (Second Generation) 1024 x 1024
iPod Touch (Third Generation) 2048 x 2048
iPod Touch (Fourth Generation) 2048 x 2048
iPhone 1024 x 1024
iPhone 3G 1024 x 1024
iPhone 3GS 2048 x 2048
iPhone 4 2048 x 2048
Samsung GT-i9100 Galaxy S2 4096 x 4096
Google Nexus S 2048 x 2048
HTC EVO 4G+ 4096 x 4096
HTC Vision (Desire Z) 4096 x 4096
LG P990 Optimus 2X 2048 x 2048
HTC G1 1024 x 1024
Barnes & Noble Nook color 2048 x 2048
Source: http://hellomobiledevworld.blogspot.co.uk/2011/09/sprite-sheets-and-maximum-texture-size.html http://hellomobiledevworld.blogspot.co.uk/2011/09/sprite-sheets-and-maximum-texture-size.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)