5 meta tags for making your website into a iOS Web App

本文详细介绍了如何使用Safari浏览器将网页转换为iOS应用,包括添加到主屏幕、视口设置、移除工具栏、更改应用状态栏颜色、应用图标设置和启动画面配置等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. Click on the launch arrow in Safari

Step 1

2. From the drop down menu select “Add to Home Screen”

Step 2

3. Don’t forget to give your Web App a name

Step 3

4. Once done your Web App should look like this:

Step 4

Viewport

Viewport changes the logical size of the viewable area on the iOS device.

1 <meta name="viewport" content "width = device-width, initial-scale = 2.3, user-scalable = yes" />

The break down

Width = The width of the viewable area. Default is 980 pixels.

Initial-scale = The Scalable area of the viewable area.

User-Scalable = “yes” to allow the user to zoom in and out of your Website and “no” to turn it off.

2. Remove Toolbars and make the Website iOS capable

1 <meta name="apple-mobile-web-app-capable" content="yes">

The Breakdown

Removing the Toolbars and making the Website iOS capable simply removes Safari’s toolbars and makes your site fullscreen.

3. Change the App Status Bar colour

1 <meta name="apple-mobile-web-app-status-bar-style" content="black" />

The Breakdown

This changes the colour of the iOS’s status bar there are three settings you can use:

  1. default
  2. black
  3. black-translucent

Note: If you use default or black the web page content will appear below the iOS’s status bar, to give your website more real estate it’s recommended using black-translucent as it makes the website appear behind the Status bar.

4. Application Icon

1 <link rel="apple-touch-icon" href="img/app-icon.png"/>

The Breakdown
This is what the user will see when they add your app to their home screen. You can specify three different types of icons depending on what device the user is using.

  1. iPod Touch, iPhone and iPad
    1 <link rel="apple-touch-icon" href="touch-icon-iphone.png" />
  2. iPhone
    1 <link rel="apple-touch-icon" sizes="114x114" href="touch-icon-iphone4.png"/>
  3. iPad
    1 <link rel="apple-touch-icon" sizes="72x72" href="touch-icon-ipad.png" />

5. Splash Screen

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

The Breakdown

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.

  • iPad Landscape – 1024 x 748
    1 <link rel="apple-touch-startup-image" sizes="1024x748" href="img/splash-screen-1024x748.png" />
  • iPad Portrait – 768 x 1004
    1 <link rel="apple-touch-startup-image" sizes="768x1004" href="img/splash-screen-768x1004.png" />
  • iPhone/iPod Touch Portrait – 320 x 480 (standard resolution)
    1 <link rel="apple-touch-startup-image" href="img/splash-screen-320x460.png"/>
  • iPhone/iPod Touch Portrait – 640 x 960 pixels (high-resolution)
    1 <link rel="apple-touch-startup-image" sizes="640x960" href="img/splash-screen-640x960.png" />
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值