iPhone 4 Retina“苹果触摸启动图像”对于网络应用程序

发布于 2024-09-25 02:28:52 字数 305 浏览 4 评论 0原文

这个问题已经在这里被问过多次,但没有一个可靠且可以理解的答案。这是一个网络应用程序,而不是本机应用程序。

我正在使用:

<link rel="apple-touch-startup-image" href="images/startup.png" />

显示启动图像。如果图像的分辨率为 320x460,则加载效果良好。我尝试使用视网膜的分辨率为 640x920(状态栏去掉了 40px),但没有成功。我尝试过@2x,但也失败了。

[还]有可能吗?

This has been asked multiple times here, but without a solid and understandable answer. This is a web-app, not a native-app.

I'm using:

<link rel="apple-touch-startup-image" href="images/startup.png" />

to display the startup image. It loads fine if the image's resolution is 320x460. I tried using the retina's resolution which is 640x920 (40px are taken out by the status bar), that didn't work. I've tried the @2x thing, that failed too.

Is it even possible [yet]?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

心房的律动 2024-10-02 02:28:52

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

    <!-- iPhone -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPhone.jpg" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">

    <!-- iPhone (Retina) -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPhone-RETINA.jpg" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

    <!-- iPhone 5 -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPhone-Tall-RETINA.jpg"  media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

    <!-- iPad Portrait -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPad-Portrait.jpg" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">

    <!-- iPad Landscape -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPad-Landscape.jpg" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">

    <!-- iPad Portrait (Retina) -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPad-RETINA-Portrait.jpg" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

    <!-- iPad Landscape (Retina) -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPad-RETINA-Landscape.jpg" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

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

This will add a Splash Screen to your Web App. Below are the sizes you’ll need for both iPad and iPhone/iPod Touch, these include the status bar area as well.

    <!-- iPhone -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPhone.jpg" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">

    <!-- iPhone (Retina) -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPhone-RETINA.jpg" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

    <!-- iPhone 5 -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPhone-Tall-RETINA.jpg"  media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

    <!-- iPad Portrait -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPad-Portrait.jpg" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">

    <!-- iPad Landscape -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPad-Landscape.jpg" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">

    <!-- iPad Portrait (Retina) -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPad-RETINA-Portrait.jpg" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

    <!-- iPad Landscape (Retina) -->
    <link href="http://www.example.com/mobile/images/apple-startup-iPad-RETINA-Landscape.jpg" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">

If creating a Web App for iPad compatibility it’s recommended that both Landscape and Portrait sizes are used.

戈亓 2024-10-02 02:28:52

文档(找到此处)说:

在 iPhone 和 iPod touch 上,图像必须为 320 x 460 像素且为纵向。

我已经测试过提供不同的尺寸,但如果尺寸不完全是 320x460,则图像将被忽略。苹果没有明确声明是否可以包含高分辨率启动图像,但论坛帖子(例如此处:Apple Dev Forum)表明目前不可能。

The documentation (found here) says:

On iPhone and iPod touch, the image must be 320 x 460 pixels and in portrait orientation.

I have tested providing different sizes, but the if the size is not exactly 320x460, the image is simply ignored. There is no clear statement from apple whether it is possible to include high res startup images, but forum posts (eg here: Apple Dev Forum) suggest that it is currently not possible.

反话 2024-10-02 02:28:52

刚刚做了测试...苹果添加了“尺寸”属性。因此,对于高分辨率,您可以添加size =“640x920”等。我想这也适用于不同的方向。

Just did the testing... apple have added the "sizes" attribute. so, for hi-res, you add sizes="640x920", etc. I suppose this works for different orientation too.

一笑百媚生 2024-10-02 02:28:52

这对我有用:

<link rel="apple-touch-startup-image" media="screen and (max-device-width: 320px)" href="images/iphone_splash.png"/>
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="images/iphone_splash_hires.png" />

This works for me:

<link rel="apple-touch-startup-image" media="screen and (max-device-width: 320px)" href="images/iphone_splash.png"/>
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="images/iphone_splash_hires.png" />
ˉ厌 2024-10-02 02:28:52

因此,如果我理解得很好,考虑到我们有 3 参数需要考虑,我们实际上需要 8 个不同的图像:

  • 设备(iPhone 或 iPad)
  • 分辨率(是否为视网膜)
  • 方向(纵向或横向)

我说得对吗?

So if I understand well, we actually need 8 different images considering we have 3 parameters to take into account:

  • Device (iPhone or iPad)
  • Resolution (retina or not)
  • Orientation (portrait or landscape)

Am I right?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文