Reputation: 34503
We have a HTML5 app at www.tekiki.com. A white page appears between the splash screen and the first page on iPhone 4s, and we have no clue how to remove this. The white page only appears on the iPhone and not the desktop.
We have tried setting the background of the element to different colors, and it doesn't make a difference. We thought about programmatically showing the splash screen instead of relying on meta tags, but we prefer the meta tag approach as it automatically shows a different splash screen for taller devices like the iPhone 5.
Can anyone help?
In ideal case, the white page instead has this color, -webkit-linear-gradient(top,#e8e4dc,#f2f0eb)
, as the background.
Thanks!
Upvotes: 4
Views: 3343
Reputation: 221
As I understand you have WebView which load HTML on AppStart. This seems takes some time and you see just empty WebView for some time after Splash Screen. This is white background.
To solve this you can do some things
Hope this will help.
Upvotes: 0
Reputation: 3780
By "only appears on the iPhone," do you mean that the white page appears after the site has been saved to the Home screen or only in Mobile Safari before it has been saved to the Home screen?
If you meant the latter, the startup image will only appear once the site has been added to the Home screen. Therefore, the white screen would simply be the interim while the page is rendering. The suggestions made by coliff would definitely help alleviate that; see my updated below as well.
If you meant the former, I just added the site to the Home screen on my iPhone 4S and did not have any issues with a white page ;) That said, there is a very brief flash of white while transitioning from the startup image to the first page. If you wish to have a smoother transition between the startup image and the first page, the suggestions made by coliff would help there as well–it should be a smooth fade out on iOS 7 and a hard transition on iOS 6.
Update
Also, try making a test page similar to the following. Once it has been saved to the Home screen, you shouldn't see a white page or flash (that I alluded to) after the startup image. This conveys that the issue is certainly related to rendering time if not entirely caused by it.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tekiki</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<!-- iPhone 4 Retina -->
<link rel='apple-touch-startup-image' media='(device-width: 320px) and (-webkit-device-pixel-ratio: 2)' href='/images/dandy/apple-touch-startup-image-640x920.png'>
</head>
<body>
<h1>PAGE LOADED!</h1>
</body>
</html>
So, a few more suggestions for optimizing the homepage of the web app:
Upvotes: 1
Reputation: 1019
I've reviewed your site and have a number of suggestions to improve performance which would certainly decrease the delay in rendering the page on an iPhone.
UPDATE: I see that there's JS that detects iPhone and redirects to http://www.tekiki.com/dandy/dandy/. A lof of the advice above stands still, but one thing I noticed - the splash screens you've used are VERY large. The iPhone 5 one is 223 KB, that's not going to load fast. Try exporting as a JPEG or 256-colour PNG to reduce the size. Compress and minify everything you can to optimise performance.
Upvotes: 0
Reputation: 2818
You have to set all the subviews of your webview and the webview itself non-opaque and with a clear background color.
for (UIView *subview in [myWebView subviews]) {
[subview setOpaque:NO];
[subview setBackgroundColor:[UIColor clearColor]];
}
[myWebView setBackgroundColor:[UIColor clearColor]];
[myWebView setOpaque:NO];
then your html code should have this
<body style="background-color: transparent;">
To finish, set the background of the superview of your webview as you like.
Upvotes: 0