Cordova Hide Status Bar
After some long hours of debugging, I finally figured out what the issue was.
In fact, the status bar was hidden, and the white bar we would see is the overlay provided by Framework7, which explains the following:
StatusBar.isVisible // false
Apparently Framework7 is hiding the status bar, but leaving a blank white bar on top of the application, which is a padding.
So to remove the bar, I had to remove the class with-statusbar-overlay
from the html
tag. And to do so, I added the following to my Javascript file:
document.documentElement.classList.remove('with-statusbar-overlay');
Note that the Javascript fix must be executed before the deviceready
event. Otherwise, you will see the home view with the bar, then the bar will disappear. If you put it before the event, the user will never see the bar.
document.documentElement.classList.remove('with-statusbar-overlay');
Dom7(document).on('deviceready', function(){
// Your code
});
Cordova: How do you hide the status bar on the splash/launch screen?
It is not the full answer that makes Cordova do it automatically. But I went into my .plist file for the iOS build and added:
UIStatusBarHidden = true
UIViewControllerBasedStatusBarAppearance = false
This makes it behave the correct way and is not getting overwritten by Cordova when I do a build so it will work for now.
If anyone finds or knows of a better way to enforce these settings, feel free to post it and I will either update this answer or choose yours next time I notice it. Thank you!
Related Topics
How to Disable iPhone 6 Native Resolution
Swift iOS9 New Contacts Framework - How to Retrieve Only Cncontact That Has a Valid Email Address
iOS Swift: How to Change the Font Style of a Certain Word in a String
Responding to Ram Availability in iOS
Get Error Code -11843 While Exporting Mp3 File in Ipod Library Since iOS 5.1
App Updates, Nsurl, and Documents Directory
Objective-C Wrapper for Cfunctionpointer to a Swift Closure
How to Detect iOS 6 and All Minor Versions by User Agent
Location Access - App Is Not Asking for User Permission to Access Location - iOS 11
Nsgenericexception Reason Collection <Nsconcretemaptable: Xxx>
How to Share Nsdata or Phasset Video Using Facebook iOS Sdk 4.0 Fbsdksharedialog
Tracking Mkmapview Centercoordinate While Panning
Uiimagejpegrepresentation Received Memory Warning
How to Display the Emoji and Special Characters in Uilabel and Uitextviews
Receive Accelerometer Updates in Background Using Coremotion Framework
Get User Profile Details (Especially Email Address) from Twitter in iOS