Web 应用程序中用于 Retina 显示的启动图像?
有人知道如何让iOS在使用时显示更高分辨率的启动图像吗?目前我只能使用 460x380 的图像,在 iPhone 4 的高 dpi 显示屏上显示时,该图像显然看起来很糟糕。我尝试了 @2x 技巧,但似乎不起作用。
有什么想法或解决方法吗?
Anybody know how to get iOS to display higher resolution startup image when using ? Currently I'm stuck with 460x380 image which obviously looks horrible when displayed on iPhone 4's high dpi display. I tried the @2x trick but didn't seem to work.
Any ideas or workarounds?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我从来没有想过我会得到这个工作,但出于某种原因,网上到处都说高分辨率图像尺寸是 640x960,它们实际上是 640x920。当您进行此更改时,高分辨率启动屏幕将在视网膜显示屏上正确显示。以下是我在我们的应用程序中使用的确切代码。我们有适用于 iPad1/iPad2 纵向和横向、iPhone3/iPhone4 的启动屏幕
希望这对某人有帮助。
I didn't ever think I would get this working, but for some reason, everywhere online states that the hi-res images dimensions are 640x960, they are actually 640x920. When you make this change, the hi-res splash screen will appear correctly on retina displays. Below is the exact code that I use in our app. We have splash screens working on iPad1/iPad2 Portrait and Landscape, iPhone3/iPhone4
Hope this helps someone.
您是否尝试过在
link
标记上使用与像素比相关的媒体查询?media="only screen and (-webkit-min-device-pixel-ratio: 2)"
用于视网膜显示屏。Have you tried using media queries related to pixel ratio on the
link
tag?media="only screen and (-webkit-min-device-pixel-ratio: 2)"
for the retina display one.iPad:
iPad:
我见过 XCode 在这种情况下出错的情况。除了仔细检查图像大小 (320x460) 之外,还可以:
我知道这可能看起来很明显或不必要,但我对同样的问题撞了头,清理/删除/删除序列修复了它。
I've seen cases where XCode messes up in this situation. In addition to double checking the image size, (320x460) it doesn't hurt to:
I know this may seem obvious or unnecessary, but I banged my head against the same problem and the clean/delete/delete sequence fixed it.
“@2x”技巧有效。一定是你的图片出了问题。
你想要两个文件。 Default.png 和[电子邮件受保护]。第一个应该是 320x460。第二个应该是 640x920。我保证它有效。
The "@2x" trick works. Must have been something wrong with your images.
You want two files. Default.png and [email protected]. The first one should be 320x460. The second should be 640x920. I promise it works.