当我用iOS 5.1编译在Xcode 4.3.1中的应用程序时,我注意到只有在实际设备上的背景纹理存在奇怪的行为。在下面的截图中显示的纹理瓷砖之间存在1px间隙。

我的纹理是150x150和300x300,在2倍。

到目前为止,我已经测试了相同的构建:

  • 模拟器iPhone / iPad均为5.0 / 5.1:没有BUG
  • iPhone / iPad运行5.0.1:没有错误
  • iPhone / iPad运行5.1:越野车

有帮助吗?

解决方案

自5 5.1以来,我一直在得到同样的问题。我通过在photoshop中的图像中完成以下操作来解决它。您可能在另一个工具中可以这样做。

  1. 加载文件,选择全部,并复制到剪贴板

  2. 在photoshop中创建一个新文件,它与具有72像素/英寸分辨率的相同维度,RGB和8位深度,其中包含白色背景。

  3. 粘贴在步骤1中复制的图像进入此图像

  4. 保存文件并使用此文件。

    执行此操作后,设备上正确显示的文件,我不必诉诸创建图像的尺寸。

其他提示

我的解决方法: 在构建设置中将“压缩PNG文件”设置为“否”。在我的情况下,App Bundle的大小甚至比压缩打开的大小甚至小。我自己做了图像优化。

just in case anyone else is having this problem and uses pngoptimizer, try a new png without optimizing it.

I had the same problem and spent the last 4 hours trying to solve it. In the end i realized it was png file from the pngoptimizer tool that somehow always worked before iOS 5.1 but with the update the same png file produces this thin line at the bottom. the strange thing is that this does only happen on the device and not in simulator and that deceives you a lot because you think it cant be the graphic. in fact it is.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top