带 iPhone 4 Retina 显示屏的 colorWithPatternImage (image@2x.png)
由于每当我输入“@2x”时,SO 的搜索功能就会崩溃,很难判断这是否已经被问过......
我一直在使用 colorWithPatternImage: 为我的各种视图构建平铺背景图像。然而,在新的 iPhone 4 显示屏上观看时,这些内容不出所料看起来就像垃圾。所以我已经构建了我的tile.png文件的@2x版本,但是colorWithPatternImage:显然无法正确处理双倍比例的UIImages。
有没有人有效地开发出解决此问题的方法?也许在 CoreGraphics 框架内(我是这个框架的新手)?
Thanks to SO's search function blowing up whenever I enter "@2x", it's difficult to tell whether this has already been asked...
I've been using colorWithPatternImage: to build tiled background images for my various views. However, these predictably look like trash when viewed on the new iPhone 4 display. So I've built @2x versions of my tile.png files, yet colorWithPatternImage: evidently can't properly handle UIImages with double the scale.
Has anyone effectively developed a workaround for this issue? Perhaps within the CoreGraphics framework (of which, I'm quite the novice)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这是 SDK 的一个错误。
colorWithPatternImage:
对高清图像做了奇怪的事情。 Apple 开发论坛上有一个小线程,但基本上我认为这是一个错误。不确定苹果是否已经意识到这一点。我通过在
-drawRect:
内视图的子类中绘制模式来解决这个问题。希望这有帮助。
I believe this is a bug with the SDK.
colorWithPatternImage:
is doing strange things with the HD image. There's a small thread on the Apple Dev Forums on it, but basically I think it's a bug. Not sure if Apple are aware of it just yet.I've worked around it by drawing the pattern in a subclass of the view within
-drawRect:
.Hope this helps.