iOS 7 web app status bar - html

I'm building an iOS web app. Since updating to iOS 7 I'm noticing the status bar has a number of issues. I'd like to get the status bar to show as white with black text/icons but I can't seem to figure it out.
The meta tags I've tried are:
Shows just an empty black bar and shifts content down:
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
Shows a black bar with white text/icons:
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
Shows a white bar with white text/icons:
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
Any ideas about what I'm doing wrong or how to get the status bar to show up as a white background with black text?

"translucent" does work for iPhones, but it is hit or miss.
You might get lucky by putting some css inside of
#media only screen (height: "iPHONES HEIGHTs"px) and (width: 320px) {
}.
The only way I got it to work on my iPad is by saving the webpage as translucentthen changing the webpage to "black-translucent" and relaunching the webapp.
7.0.4 came out today and it's still a problem. Come'on Apple :(

I'm building an iOS web app. Since updating to iOS 7 I'm noticing the status bar has a number of issues. I'd like to get the status bar to show as white with black text/icons but I can't seem to figure it out.
I did it. Here is answer for you.
https://github.com/BYODKM/pwdGen/blob/gh-pages/index.html#L8-L16
Point is; App should be saved with "black-translucent" onto Home Screen, but run with "default".

If you remove this meta line, make your background color white it will show a white status bar.
The browser will take a tint of your body background-color. As far as i checked and notices also for your statusbar. It seems all integrated in the browser frame

Related

safe-area-inset-bottom not working on ios 15 safari

I'm trying to get my website to fit inside my phone screen. I have tried many variations of env(safe-area-inset-bottom) and constant(safe-area-inset-bottom) but both always return 0px (I've been using an app called Inspect to debug CSS on my iPhone 13).
Here's a link to the github repo. All code that relates to this issue should be in /src/app.tsx. Here is a link to the live site if you want to see the problem yourself.
UPDATE: I've been doing some testing and have found that in portrait mode, safe-area-inset-* is ALWAYS 0px, but in landscape mode it works as expected. Does this mean that safe-area-inset-* isn't the correct solution for ios 15 safari? Clearly the url bar obscures the 'safe area' in portrait mode...
I've made sure to add <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> to my head tag but this has no effect. Could someone please explain how I can ensure that my site doesn't go past the bottom URL bar on ios 15 Safari? I've attached screenshots from my phone showing the problem:
I think I made it work using -webkit-fill-available the other day which respects safe area.
body {
min-height: -webkit-fill-available;
}

Issue with iOS 11 full screen web app on iPad and the status bar

I have a full screen home screen web app that is designed for 1024x768 resolution so it fits perfectly on the iPad in landscape mode. Or at least, it did, until the iOS 11. This update now has content rendered under the status bar which pushed the entire page down 20 pixels. My meta-tags involved are as follows:
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="initial-scale=1,user-scalable=no,viewport-fit=cover">
I was under the impression that the "viewport-fit=cover" would fix this returning to the iOS 10 behavior where the status bar was transparent and "floated" above the HTML instead of pushing it down.
Does anyone know if this is a bug or if I am doing something incorrectly so I can once again get this to display full screen and fit perfectly?
Edit: This appears to be a bug with iOS 11, among other issues with fullscreen web apps. https://forums.developer.apple.com/message/268185
On iOS 11 all styles break in landscape mode after you change the orientation,
and you have choose which one you want to live with.
On orientation changes they add either a bar on top or at the bottom:
Freshly loaded (default, black and black-translucent):
top spacing in black or default white:
bottom spacing in black-translucent, being the pink background color:
iPhone SE, iOS 11, Full Album, Code

HTML page, iPad orientation change redraws incorrectly - displays split view

I'm having a problem on a web page where an orientation change (landscape to portrait, or portrait to landscape) causes the window to display incorrectly:
The display reorients, correctly for a brief instance, and then an incorrectly scaled column appears on the left hand side. The incorrectly scaled portion of the window is part of the pre-rotated page (oriented correctly).
Reloading the page fixes the problem (until the next orientation change).
At the moment, I only have an iPad mini 7.0.3 to test on.
For tablets, there is no orientation change function, and this displays fine on Android tablets.
I can't find anything online about this... is it a known bug?
The viewport meta looks like:
<meta name='viewport' content='width=device-width, width=device-width, height=device-height, user-scalable=yes'>
------------------------ update: ------------------------
I whittled down the page, and the results are:
1. I have included some fonts from http://openfontlibrary.org
2. I have a <ul> on the page
If I remove either of these, the problem goes away! (probably something other than <ul> will cause this as well, since at least one of the pages shows the problem without this tag).
Will research further... it would be a shame if I couldn't embed fonts!
you can try adding this to your body tag:
onresize="location.reload()"
this should reload the page when the vieuwport changes.

iOS 8: web app status bar position and resizing problems

When setting the meta tags
apple-mobile-web-app-capable
and
apple-mobile-web-app-status-bar-style
to create a full screen web app, the iOS status bar is at the top of the screen (translucent) and there's an additional empty black bar at the bottom.
Here's my code:
<!DOCTYPE html><html><head><meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<body><h1>Test</h1>
<p>Capture a photo using camera</p>
<input type="file" capture="camera" accept="image/*">
</body></html>
There's an additional problem with the tag apple-mobile-web-app-status-bar-style. After taking and accepting a photo via camera input black bars appear on the sides of the screen.
I'm using iOS8 GM on an iPad3.
I think this might be an iOS 8 bug but Apple doesn't seem to care about my bug report :(
Does anyone know a solution/workaround for this problem?
Update 1:
Apple marked my bug report as Duplicate (Closed) on Sept. 19th.
Update 2:
Bug is fixed in iOS 8.3 Beta 1
Technically this is not an answer to your question, but I have been documenting my findings while trying to resolve this issue myself, and here is what I've found so far. I was going to post it as it's own question, but figured it would be closed as a duplicate.
On iOS8 devices running pinned web applications. Regarding the tag :
<meta name="apple-mobile-web-app-status-bar-style" content="black">
From the Apple developer reference:
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. The default value is default.
To enable this functionality, you need to use
<meta name="apple-mobile-web-app-capable" content="yes">
In iOS6 and 7 this works more or less as expected.
In iOS8 this appears to be broken entirely. For example, iOS 8.0.2 running on an iPad Air in portrait has the following behaviour:
black results in a transparent background. There is a solid black bar at the bottom of the screen
default or not setting a value results in a transparent background and a solid white bar at the bottom of the screen
black-translucent results in a transparent background, but no annoying bars at the bottom of the screen
In all cases, the content appears "beneath" the bar. i.e. the bar does not push content down.
On an iPhone6, the status bar does not display at all in landscape. In portrait however, the following behaviour:
black works as expected, and content is pushed down (wow!!!)
default has an empty white bar at the top
black-translucent results in a transparent background, with content underneath
I have not had the opportunity to test on an iPhone6+
The iOS simulator in xcode does not appear to give reliable reproduction of the behaviour that occurs on real devices.
I have tried changing it dynamically with javascript, but it appears to have no effect.
Just to make this even more interesting/frustrating, you can COVER the status bar (clock/wifi etc) by setting styles on the html element. e.g.
html {background: black;}
body {background: #DDD; margin-top: 20px}
The same issue documented elsewhere:
https://discussions.apple.com/thread/6557230?start=0&tstart=0
The problem existed since iOS6.
I had previously posted to Apple's bug report with all details you are providing today, and later was marked as duplicate. This was 2 years ago and unfortunately today I discovered that it got even worst.
The original bug report has id 11966202 and is still (Open).
Since you have the same problem the only thing you could do is confirm the bug which will escalate it and they will fix it in the future.
As I said I am looking for a solution for more that enough to tell you there is no workaround.
The problem can be reproduced on all iOS devices, but behaves differently based on the screen size and orientation.
With iOS 8 we now experience a glitch where the viewport becomes just a very small portion of the screen and it closes/crashes completely.
EDIT: Apple Ticket is now closed
As of Monday, Apple had closed the ticket and I can confirm that using 8.1 finally resolves the camera and status bar issues I was having. Hope it resolved your issues too :)
The issue comes from using <meta name="apple-mobile-web-app-status-bar-style" content="black">In order to get rid of the black bar at the bottom of your app, you will need to use:<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> Using black-translucent will keep your app looking the same in both iOS7 and iOS8. You will still need to adjust any content at the top of your app to clear the iOS status bar icons.
Apple fixed this bug in iOS 8.3 beta 1
To expand on all of the above, my solution is:
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
Then create a custom CSS for all the elements that need to shift down by 20px, particularly any position: fixed; top: 0px; that exists in your CSS for normal browser [desktop/mobile] view.
Add the custom CSS into the head section, below CSS links with the following script [my working example]
<script type="text/javascript">
if (window.navigator.standalone) {
document.write("<link type=\"text\/css\" rel=\"stylesheet\" media=\"all\" href=\"assets/css/style-body-ios8.css\" charset=\"utf-8\" \/>");
}
</script>
My result is desktop/mobile browser website view is as normal, then website added to home screen as a web app, on launch opens fullscreen, with status bar looking like it used to pre ios8 [fyi, I added a background color of black to my fixed header css for the status bar to show as black background
Tested on iPad/iPhone/iPod running ios 8.0.2 - all good. FYI, tested on old iPod ios 6.1.6 expecting an extra shift down of 20px and wasn't there - bonus!
It is worth noting that setting the status bar style to 'black' is working as expected as long as you open the Web App with your iPad in Portrait. Then even if you rotate the iPad the black bar is correctly visible.
The problem is only when you enter the Web App in landscape, at least for me. I am using iPad 3 with IOS 8.1, and I believe it is still the same in 8.3
Just add a 20px high div to the top of your app and let that act as that status bar
apple-mobile-web-app-status-bar-style is inactive in iOS 8.
If you add a fixed div on top, only add it for OS 8_0
if (navigator.appVersion.indexOf("OS 8_0 like Mac") > 0) ...

Removed responsive design elements from css, but narrow mobile-width background is still showing up

I just want this to display the same on computers and on mobile devices, not doing any responsive design for this project.
I've gone through the CSS and commented out everything having to do with a mobile version.
However, my site is still displaying incorrectly on mobile devices. The content is showing as desired (for the most part), but the background is shrunk and narrow like it is trying to display at the mobile page-width.
I've tried multiple devices, so this is not a cache problem.
Can anyone tell me where I am going wrong?
http://www.carolinafarmstewards.org
Here's an image of what it looks like on my phone:
Try removing <meta name="viewport" content="width=device-width" /> from the head.