【问题标题】:iPhone 4 Retina “apple-touch-startup-image” for Web-apps (landscape)iPhone 4 Retina “apple-touch-startup-image” 用于 Web 应用程序(横向)
【发布时间】:2023-03-25 04:57:01
【问题描述】:

希望以前没有人问过这个问题。

我有以下工作

<!-- 640x920 for retina display -->
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="images/iphone4-portrait.jpg" />

我知道图像必须是 640x920 否则它将无法工作
我知道这没有横向选项吗?或者有吗?

所以...关于我的问题,当从主屏幕以横向加载网络应用程序时,您可以看到启动屏幕后面的页面内容(下面的横向图像中较浅的绿色区域),状态栏所在的位置肖像

有没有人遇到过这个问题,如果有,你是如何解决的。

谢谢

【问题讨论】:

  • 您的横向启动图像与纵向图像的尺寸相同吗?这样就可以解释了。
  • 是的,图像大小相同,但 Iphone 没有横向选项,我无法更改大小,如果我这样做将无法正常工作

标签: iphone web-applications mobile-safari iphone-4 retina-display


【解决方案1】:

让这些工作完全是一场噩梦。

在 git hub (https://gist.github.com/472519) 上,它说视网膜应该是 &lt;link rel="apple-touch-startup-image" media="screen and(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="apple_launch_640x920.png" /&gt; - 每个人都说它应该是确切的尺寸,否则它不会起作用但每个人都说不同的尺寸。

除此之外,应用程序似乎会缓存(现在在 iOS5.1 中可能没有,但我不确定)所以如果你没有得到它,你无法知道你是否做对了第一次正确。

我真的真的真的很希望 Apple 将代码发布在其开发信息的某个地方,并给出明确的答案(包括 iPad Retina),这样我们就可以将其视为应有的 10 分钟工作,而不是浪费数小时、数小时和数小时胡闹...:(

我至少在 iPad 2 上找到了以下作品——iPad2 横向版本实际上是纵向的,内容是旋转的,所以制作横向版本 (748x1024) 然后顺时针旋转 90 度就可以了。

<!-- startup image for web apps - iPad - landscape (748x1024) 
 Note: iPad landscape startup image has to be exactly 748x1024 pixels (portrait, with contents rotated).-->
<link rel="apple-touch-startup-image" href="/apple_launch_748x1024.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)" />

<!-- startup image for web apps - iPad - portrait (768x1004) -->
<link rel="apple-touch-startup-image" href="/apple_launch_768x1004.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)" />

其余的怎么办,虽然我不知道,我没有旧的 iphone 或视网膜 ipad,这一切都太不稳定了,不管它是否有效,有人猜测......

【讨论】:

    【解决方案2】:

    iPhone 没有横向启动屏幕规格。这是因为 iPhone 在设备横放时不会旋转其主屏幕 - 用户将始终从纵向启动。

    但是,如果您坚持需要此功能,则可以将常规启动屏幕放在一边,向用户建议他们需要转动手机。

    【讨论】:

      【解决方案3】:

      您不能在 iPhone 上使用横向启动图像。横向图像仅适用于 iPad。此外,您必须在 iPhone 上使用合适的尺寸,否则它根本不会显示。

      这将为您的 Web 应用程序添加一个启动画面。以下是 iPad 和 iPhone/iPod Touch 所需的尺寸,其中还包括状态栏区域。

      iPad 横向 - 1024 x 748

      <link rel="apple-touch-startup-image" sizes="1024x748" href="img/splash-screen-1024x748.png" />
      

      iPad 纵向 - 768 x 1004

      <link rel="apple-touch-startup-image" sizes="768x1004" href="img/splash-screen-768x1004.png" />
      

      iPhone/iPod Touch 纵向 - 320 x 480(标准分辨率)

      <link rel="apple-touch-startup-image" href="img/splash-screen-320x460.png" />
      

      iPhone/iPod Touch 纵向 - 640 x 960 像素(高分辨率视网膜显示屏)

      <link rel="apple-touch-startup-image" sizes="640x960" href="img/splash-screen-640x960.png" />
      

      如果创建与 iPad 兼容的 Web 应用程序,建议同时使用横向和纵向尺寸。

      【讨论】:

        猜你喜欢
        • 2011-04-17
        • 2011-06-08
        • 1970-01-01
        • 2012-09-09
        • 2013-06-27
        • 2011-02-07
        • 2021-11-07
        • 2011-03-08
        • 2011-09-19
        相关资源
        最近更新 更多