我有一个高度为 2000px 的 css 图像无法在 iOS7 设备上加载 - 我尝试了不同的高度,发现 1949px 有效而 1950px 无效。
我使用了一些不同的图像,发现导致加载失败的绝对是高度而不是文件大小。
有谁知道为什么图像无法在 iOS7 上加载?
最佳答案
根据 Safari Dev library由于设备上的可用内存存在限制。
在了解 iOS 资源限制下
The maximum size for decoded GIF, PNG, and TIFF images is 3 megapixels for devices with less than 256 MB RAM and 5 megapixels for devices with greater or equal than 256 MB RAM.
That is, ensure that width * height ≤ 3 * 1024 * 1024 for devices with less than 256 MB RAM. Note that the decoded size is far larger than the encoded size of an image.
The maximum decoded image size for JPEG is 32 megapixels using subsampling.
所以它实际上可能取决于文件大小,而不是实际的高度和宽度。
关于iOS7 不加载高度超过 1950px 的 css 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26754786/