iPhone 应用程序中 PNG 透明度未正确混合?
这是我的第一个 iPhone 应用程序,我在其中从 Photoshop 批量导入图像。有些无法正确渲染。
下图是一个白色的圆角按钮;整体透明度被保留,但从图像到透明像素的混合会导致每个角周围出现白色边缘:
http://adambossy.com/media/images/white%20corners%20in%20app.png
角应如下所示:
http://adambossy.com/media/images/normal%20corners%20in%20photoshop.png
除了启动画面和图标所需的规格(72ppi、RGB、8 位/通道等)之外,我找不到 PNG 规格,因此我遵循这些规格。按钮图像在我的浏览器中在黑色背景下看起来很好。但是,当导入应用程序(模拟器和设备)时,它渲染不正确。
有什么想法吗?
This is my first iPhone app in which I am importing images wholesale from Photoshop. Some aren't rendering properly.
The following image is a white button with rounded corners; the transparency overall is being preserved, but the blending from the image to the transparent pixels results in a white edge around each corner:
http://adambossy.com/media/images/white%20corners%20in%20app.png
The corners should look like this:
http://adambossy.com/media/images/normal%20corners%20in%20photoshop.png
I can't find PNG specs outside of those required for the splash screen and icon (72ppi, RGB, 8 bits/channel, etc.) so I am following those. The button image looks fine in my browser against a black background. However, when imported into the app (simulator AND device), it renders incorrectly.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用什么类型的按钮?
使用自定义 UIButton
What type of button are you using?
use a custom UIButton
您可能会遇到透明颜色的问题。另外,请注意,Xcode 默认情况下会优化 PNG。
You might be experiencing problems with the clear color. Also, be aware that Xcode will optimize PNGs by default.