1

I am creating a button for my application that, when pressed shows an indention looking effect to make it appear that the user is clicking a real button. It is very simple, using only an image for the default state and the depressed one for the highlighted state. I'm having a few problems. The quality is terrible. I have uploaded the images to XCode in the exact pixels they will be presented in my application but when I export it from Illustrator it gets really pixelated. So I was wondering if there was a way for me to upload an image a few times bigger than my button and have it shrink to fit the button size. I've tried to do that but when I run my app it gets really messed up and weird looking. I would just put text inside the button but then it ruins the pressed effect. Any ideas?

4

1 回答 1

0

如果您以与按钮相同的纵横比导出图像,则图像将重新缩放以适合您的按钮。不要忘记使用自定义样式,这样您就不会得到椭圆形的按钮。

但是,应该可以生成按钮的精确像素版本,并且看起来不错 - 特别是如果您指定 2x 大小的 @2x 版本的图像供视网膜使用。您确定您的 Illustrator 导出设置正确吗?需要考虑的一件事是,可能需要在导出时启用抗锯齿功能。

此页面有一个有用的快速清单,了解如何从 Illustrator 中为 iPhone 保存(向下滚动到“如何在 Illustrator 中为 iPhone 保存艺术”标题)

http://www.vickiwenderlich.com/2011/11/faq-how-do-i-save-art-for-the-iphoneipad/

于 2012-12-20T05:25:37.130 回答