Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does apple-mobile-web-app-status-bar-style do?

Tags:

What does

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

do -- can someone explain with an example?

I found this line in the official Safari Developer Library

This meta tag has no effect unless you first specify full-screen mode as described in “url.”

But which url?

What is the benefit of this meta tag?

like image 584
Jitendra Vyas Avatar asked Jul 05 '11 12:07

Jitendra Vyas


People also ask

What is mobile web app capable?

Chrome on Android now supports a meta-tag mobile-web-app-capable : Since Chrome M31, you can set up your web app to have an application shortcut icon added to a device's homescreen, and have the app launch in full-screen "app mode" using Chrome for Android's "Add to homescreen" menu item.

How can I add status bar in IOS?

@learner Goto info. plist and then select any row. You will see a + sign. Click on Plus sign and from drop down, you should see Status bar style Option.

Which of the following meta tags indicates that the web application runs in a full screen mode?

What the meta tag do is when you view your page in the browser, it adds an option to add your page to the homescreen. When you open your page via the homescreen shortcut, it will be in fullscreen and navigator. standalone will be set to true. This is what people refer to when they speak of the fullscreen mode.


1 Answers

First, the apple-mobile-web-app-capable hint has to be set for that to even work. This hint causes a web application to run in full-screen mode: it removes the address bar and navigation buttons you get by default in Mobile Safari. The removed areas are highlighted in red here:

apple mobile web app capable

So, once an app is in full-screen mode (i.e. the user has added the website to their home page), you can also control the colour of the remaining thin status bar at the top of the page with apple-mobile-web-app-status-bar-style, highlighted in red here:

apple mobile web app status bar style

Per the docs:

If content is set to default, the status bar appears normal. If set to black, the status bar has a black background. If set to black-translucent, the status bar is black and translucent. If set to default or black, the web content is displayed below the status bar. If set to black-translucent, the web content is displayed on the entire screen, partially obscured by the status bar.

A couple of caveats:

  1. This only works on the first page you load; any navigation away to another page will make the address bar and navigation buttons reappear. So if you want this to work, you have to build a single page website (for multiple 'pages' consider an Ajax page loading approach such as that used in the jQuery Mobile framework).

  2. This only works when you arrive at the web page via an application shortcut icon; if you navigate to the website directly from within Mobile Safari it has no effect.

like image 185
Ben Avatar answered Sep 28 '22 02:09

Ben