Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Status Bar on iOS Background Color

I’m having a hard time setting the iOS status bar background color to transparent. I’m using the latest version of cordova statusbar and ionic, and leaving everything to their default setting, however i’m getting a white background color for some reason. How can i set the background color to transplant, i though this is the default value anyhow.

ios-statusbar

like image 623
Yehia A.Salam Avatar asked Oct 30 '17 02:10

Yehia A.Salam


2 Answers

Okay so after referring to:

  • https://issues.apache.org/jira/browse/CB-12886 and
  • https://issues.apache.org/jira/browse/CB-12890

The issue occurs in iOS 11, and cordova-ios-4.5.0 and is simply solved by adding the cover value to viewport-fit as follows in your index.html:

   <meta name="viewport" content="viewport-fit=cover, initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width" />
like image 184
Yehia A.Salam Avatar answered Oct 30 '22 06:10

Yehia A.Salam


This worked for me:

  1. Run cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git

  2. config.xml Add <preference name="StatusBarBackgroundColor" value="#" /> inside <platform name='ios'> tag

  3. index.html Add <meta name="viewport" content="viewport-fit=cover, initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width" />

  4. Save.

  5. Launch the simulator.

Screenshot of transparent statusbar

like image 24
saintmarina Avatar answered Oct 30 '22 07:10

saintmarina