iphone - CSS 背景 Sprite 对于 iPhone 来说太大了

标签 iphone css safari responsive-design css-sprites

我有一个尺寸为 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/

相关文章:

ipad - iPad Safari HTML5音频播放

javascript - iOS 键盘不关闭,由 iframe 中的输入触发

iphone - 如何在 iOS 上以全精度打印 double ?

javascript - 表格内的重叠图像

html - 在 div 中居中文本,div 在 Safari 中不显示

html - CSS制作:before element inherit size (491th time)

php - 日历自定义 [突出当前月份]

iphone - 如何在 iOS 的 post 请求中发送表单数据?

ios - 应用程序激活后图像比较不起作用

iphone - Apple iad 已加载但未显示,是否计入展示次数?