Skip to content

[iOS] StatusBarStyle {lightcontent} are always set to {darkcontent} with [email protected] #192

Open
@mosabab

Description

@mosabab

Bug Report

Problem

<preference name="StatusBarStyle" value="lightcontent" /> not work take the action when you build the iOS.

What is expected to happen?

<preference name="StatusBarStyle" value="lightcontent" /> should be take the action when you build your iOS app.

What does actually happen?

If you set <preference name="StatusBarStyle" value="lightcontent" /> in your config.xml and you try to build your project with cordova platform add [email protected]
And after that open the project at Xcode, you will see that statusbar set to default which mean: (dark text, light background) instead of lightcontent which mean: light text, dark background

In other words:
What actually happened for now is:
The default value {lightcontent} appear as {dark text for light background}.

Information

What i did to fix this issue as a temporary solution, I change the the style manually by js code after onDeviceReady() like the following:

function onDeviceReady() {
StatusBar.styleLightContent();
}

Command or Code

In your config.xml put the preference to <preference name="StatusBarStyle" value="lightcontent" />
And after building your app using cordova command cordova platform add [email protected] , try open the project in Xcode.

Environment, Platform, Device

macOS, iOS 13.5, iPhone Series (8, 11) or even emulator.

Version information

Cordova CLI v9.0.0
cordova-plugin-statusbar #master version.
Xcode 11.5
cordova-ios v6.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions