Giter Club home page Giter Club logo

Comments (12)

burkeholland avatar burkeholland commented on July 21, 2024 2

Ah. Thank you.

It appears that iOS requires this to be done at the app delegate level. You have to set the info.plist (located in app/App_Resources/iOS) key turning off View Controller based Status Bar Appearance...

<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

You then have to specify the status bar style in the app delegate....

import application = require("application");
class MyDelegate extends UIResponder implements UIApplicationDelegate {
    public static ObjCProtocols = [UIApplicationDelegate];

    applicationDidFinishLaunchingWithOptions(application: UIApplication, launchOptions: NSDictionary): boolean {

        // set the status bar to light content
        UIApplication.sharedApplication().statusBarStyle = 1; 

        return true;
    }

    applicationDidBecomeActive(application: UIApplication): void {
        console.log("applicationDidBecomeActive: " + application)
    }
}
application.ios.delegate = MyDelegate;
application.start({ moduleName: "pages/home/home" });

from nativescript-statusbar.

raefa avatar raefa commented on July 21, 2024 2

Thanks Burke. That did the job.

For those using js rather than ts, here it is in JavaScript:

var AppDelegate = UIResponder.extend({
  applicationDidFinishLaunchingWithOptions: function () {
    // Set the status bar to light content
    UIApplication.sharedApplication().statusBarStyle = 1;
    return true;
  }
}, {
  name: "AppDelegate",
  protocols: [UIApplicationDelegate]
});
application.ios.delegate = AppDelegate;

from nativescript-statusbar.

tjvantoll avatar tjvantoll commented on July 21, 2024 2

Just to note, if you don’t want to hardcode the 1 here, iOS does provide an enum you can use. UIStatusBarStyle.LightContent === 1

from nativescript-statusbar.

3rror404 avatar 3rror404 commented on July 21, 2024 2

sharedApplication is now a property.

UIApplication.sharedApplication().statusBarStyle = 1;

should now be

UIApplication.sharedApplication.statusBarStyle = 1;

Tripped me up there for a while.

from nativescript-statusbar.

donaldking avatar donaldking commented on July 21, 2024

Experiencing the same issue as well.

from nativescript-statusbar.

burkeholland avatar burkeholland commented on July 21, 2024

Did you try removing the ios attribute and adding the
backgroundSpanUnderStatusBar to the page XML?
On Wed, Feb 24, 2016 at 7:17 PM Donald King [email protected]
wrote:

Experiencing the same issue as well.


Reply to this email directly or view it on GitHub
#2 (comment)
.

from nativescript-statusbar.

donaldking avatar donaldking commented on July 21, 2024

@burkeholland This is my set up:

<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded" xmlns:x="nativescript-statusbar" class="mainGreen" backgroundSpanUnderStatusBar="true"> <x:StatusBar ios:barStyle="light" android:barStyle="#00C0F5" />

from nativescript-statusbar.

raefa avatar raefa commented on July 21, 2024

Yes. I tried that too.

<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:x="nativescript-statusbar" loaded="loaded"
backgroundSpanUnderStatusBar="true">

Raef Akehurst

[email protected]
+61 (0)402 884 406

On Thu, Feb 25, 2016 at 12:26 PM, Donald King [email protected]
wrote:

@burkeholland https://github.com/burkeholland This is my set up:

xmlns:x="nativescript-statusbar"
class="mainGreen"
backgroundSpanUnderStatusBar="true">


Reply to this email directly or view it on GitHub
#2 (comment)
.

from nativescript-statusbar.

burkeholland avatar burkeholland commented on July 21, 2024

I assume you're getting a white status bar on iOS? What happens when you
remove the statusbar component?
On Wed, Feb 24, 2016 at 8:11 PM Raef Akehurst [email protected]
wrote:

Yes. I tried that too.

<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:x="nativescript-statusbar" loaded="loaded"
backgroundSpanUnderStatusBar="true">

Raef Akehurst

[email protected]
+61 (0)402 884 406

On Thu, Feb 25, 2016 at 12:26 PM, Donald King [email protected]
wrote:

@burkeholland https://github.com/burkeholland This is my set up:

xmlns:x="nativescript-statusbar"
class="mainGreen"
backgroundSpanUnderStatusBar="true">


Reply to this email directly or view it on GitHub
<
#2 (comment)

.


Reply to this email directly or view it on GitHub
#2 (comment)
.

from nativescript-statusbar.

donaldking avatar donaldking commented on July 21, 2024

@burkeholland How do you remove it? since it wasn't specifically added?

from nativescript-statusbar.

burkeholland avatar burkeholland commented on July 21, 2024

I mean, without the status bar specified, does the
backgroundSpanUnderStatusBar work? If so, does it stop working when you
then add the StatusBar?
On Thu, Feb 25, 2016 at 5:53 AM Donald King [email protected]
wrote:

@burkeholland https://github.com/burkeholland How do you remove it?
since it wasn't specifically added?


Reply to this email directly or view it on GitHub
#2 (comment)
.

from nativescript-statusbar.

raefa avatar raefa commented on July 21, 2024

Hi Burke. StatusBar works with and without backgroundSpanUnderStatusBar ... just not on the first page. In the attached image I have the difference scenarios. I hope this helps.

Top Image:
First page of my app (intro.xml) without backgroundSpanUnderStatusBar. Status bar is white as you would expect.

Middle Image:
First page of my app (intro.xml) with backgroundSpanUnderStatusBar. Status bar text is black but you would expect it to be white.

Bottom Image:
Login page of my app (login.xml). Same code uses as in the example above. Given it is not the firsst page the plugin seems to kick in and work because the status bar text is white.

temp

from nativescript-statusbar.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.