我有一个尺寸为 2000x2000 像素的 CSS 背景 Sprite 表。在所有桌面浏览器中工作正常,但在 iPhone 的 Safari 上它根本不呈现。
将尺寸降低到 1000x1000 使其呈现完美。 (好吧,除了我现在错过了 Sprite 表的四分之三这一事实)。
背景图片的尺寸是否有限制? 2000x2000 不是那么大。试图绕过重做大量 css 定位的工作。
此外,我正在为布局使用媒体查询(最大宽度,而不是最大设备宽度)。但我仍然使用相同的图形。
编辑:啊是的,它在 Android 设备上工作得很好。
最佳答案
我们在 iPad 和 iPhone 上遇到了同样的问题。最安全的选择是使用 1024x1024 像素或更少。最终我们不得不将 sprite sheet 分成两部分,然后再做一次 CSS。
根据 http://www.glbenchmark.com/和 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
来源:http://hellomobiledevworld.blogspot.co.uk/2011/09/sprite-sheets-and-maximum-texture-size.html
关于iphone - CSS 背景 Sprite 对于 iPhone 来说太大了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13514919/