Skip to content

Support status bar styles without action bar on iOS #7153

Closed

Description

@Frederiks96

Is your feature request related to a problem? Please describe.
Currently, the status bar style is only applied while the action bar is visible. If (in a non-action bar page) the background of the page requires the status bar text to be white on both iOS and Android, the developer must make the action bar transparent, resulting in platform specific code, since this works on Android.

Describe the solution you'd like
The Page component respects the statusBarStyle property even if the action bar is hidden.

Describe alternatives you've considered
None.

Additional context
The simple solution is to implement a getter for the preferredStatusBarStyle computed property on UIViewController in page.ios.js:

Object.defineProperty(UIViewControllerImpl.prototype, "preferredStatusBarStyle", {
    get: function () {
        var owner = this._owner.get();
        if(owner) {
            // Assuming the statusBarStyle is of type 'string'
            return owner.statusBarStyle === "dark" ? 1 : 0;
        }
        // No owner - default to standard
        return 0;
    },
    enumerable: true,
    configurable: true
});

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

  1. NickIliev commented on Jan 10, 2020

    @NickIliev
    Contributor

    +1 Requested via t.1448755

  2. NickIliev commented on Jan 10, 2020

    @NickIliev
    Contributor

    Possible solution hint:

    Override preferredStatusBarStyle in the viewController of page and return the value of this property. When the property is updated, call viewController.setNeedsStatusBarAppearanceUpdate().

  3. NickIliev commented on Jan 10, 2020

    @NickIliev
    Contributor

    Additional information related to t.1448755

    I tested a bit more and I also found these things that sound a bit off.

    With two pages with a different color scheme, using swipe or pan morphs from one to the other.
    When I use the back button in the same scenario, no morphing is done and target color is applied after the slideLeft is finished.
    With the target page without actionBar, and I start panning, the target color is used instantly, and when I stop without completing the back navigation, the target color stays on the actionBar.

  4. NickIliev commented on Jan 10, 2020

    @NickIliev
    Contributor

    The solution could be based on this solution

  5. vakrilov commented on Jan 15, 2020

    @vakrilov
    Contributor

    The issue seems to be resolved with #8241.
    Version already available in next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions