Reputation: 10074
ive made a phonegap / cordova 1.7 app its all working fine but when ever i go to load a page it loads it about 15px too low and then jumps up.. this only takes part of a second but the jump is noticable to the eye. i think that it has somthing to do with the status bar being hidden ive hidden it using the Status bar is initially hidden : YES
in the plist, which i believe only hides it on load rather than having it perminetly hidden..
is there a better way to do this ?
Upvotes: 1
Views: 2990
Reputation: 950
[[UIApplication sharedApplication] setStatusBarHidden:YES];
The above code snippet (written in didFinishLaunchingWithOptions method) initially hides the iPad status bar while the splash screen is running.
Now place the following code in webViewDidFinishLoad method to show the status bar after loading the application
if([[UIApplication sharedApplication] respondsToSelector:@selector(setStatusBarHidden: withAnimation:)])
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
else
[[UIApplication sharedApplication] setStatusBarHidden:NO];
Note: Adjust the body css accordingly (I placed top:20px to adjust the body position)
Thanks, Prodeveloper.
Upvotes: 1
Reputation: 2615
I just made my application splash screen image 20px bigger, and now it is working fine.
Upvotes: 0
Reputation: 1038
iOS correct, is this only on an iPad? Do you have a launch image set? If so, you need to heed Apple's guidelines about the correct dimensions of the launch image and make it 20px higher than it should be. You should be seeing a 20px jump, not 15px. For Retina displays, you need to make the launch image 40px higher than Apple's guidelines.
Let me dig up a link that confirms this behavior. I just went through it myself.
edit: here's the link Phonegap iPad App Splash / Launch Screen Shifts on deviceReady
In my iOS Cordova app, making the launch image 20px higher than the guidelines (non-Retina) and 40px higher than the guidelines (Retina) fixed the issue. The only thing that remains is a warning in Xcode that the size of the image is incorrect. However it still works and Apple doesn't reject due to this.
Upvotes: 2