Giter Club home page Giter Club logo

nativescript-statusbar's Issues

Support for NS + Angular

I got the following code snippet from previous issue.

registerElement("StatusBar", () => require("nativescript-statusbar").StatusBar);

@Component({
    selector: "Login",
    moduleId: module.id,
    template: `<StatusBar ios:barStyle="light" android:barStyle="#4286f4" #fff></StatusBar>`
})

It does not work with NS 3.1.4 + Angular

Not working with Angular modals in Android

When creating a full-screen modal with the ModalDialogService, the StatusBar changes do not go on the modal but on the page behind it. You can tell this by hitting the back button, and the changes persist on the previous page (as mentioned in this issue).

Does not change the status bar color on the first page (iOS)

Thanks for the module. Much easier than the old alternatives!

I may be doing something wrong here but this worked great for me on subsequent pages, but on the "start" page (where I added the module) it did not work. I note that I don't have an ActionBar on the start page and I am combining it with BackgroundSpanUnderStatusBar on that page.

<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:x="nativescript-statusbar" loaded="loaded">
  <x:StatusBar ios:barStyle="dark" android:barStyle="#E34900" />
  ...
exports.loaded = function(args) {
  var page = args.object;
  page.backgroundSpanUnderStatusBar = true;
}

Any ideas how I could change the colour on this start page?

After closing App status bar changes color to black

I have noticed that if I close my app and leave it running in the background and I resume it, the status bar color changes to black even though I have the element defined in every page. However, after relaunching the app status bar displays my defined color.

NS 5+
Android: API 26+ (NS Android 5+)

Haven`t tested on iOS yet

Does this work with NNG2?

JS: Error: Uncaught (in promise): TypeError: this.page.frame._getNavBarVisible is not a function
JS:     at resolvePromise (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:416:31)
JS:     at /data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:393:13
JS:     at ZoneDelegate.invoke (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:190:28)
JS:     at Object.NgZoneImpl.inner.inner.fork.onInvoke (/data/data/org.nativescript.test/files/app/tns_modules/@angular/core/bundles/core.umd.js:6242:41)
JS:     at ZoneDelegate.invoke (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:189:34)
JS:     at Zone.run (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:83:43)
JS:     at /data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:449:57
JS:     at ZoneDelegate.invokeTask (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:223:37)
JS:     at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (/data/data/org.nativescript.test/files/app/tns_modules/@angular/core/bundles/core.umd.js:6233:41)
JS:     at ZoneDelegate.invokeTask (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:222:42)
JS: Unhandled Promise rejection: this.page.frame._getNavBarVisible is not a function ; Zone: angular ; Task: Promise.then ; Value: TypeError: this.page.frame._getNavBarVisible is not a function 
TypeError: this.page.frame._getNavBarVisible is not a function
JS:     at ActionBar.update (/data/data/org.nativescript.test/files/app/tns_modules/ui/action-bar/action-bar.js:146:50)
JS:     at ActionBar.onLoaded (/data/data/org.nativescript.test/files/app/tns_modules/ui/action-bar/action-bar.js:140:14)
JS:     at eachChild (/data/data/org.nativescript.test/files/app/tns_modules/ui/core/view-common.js:736:23)
JS:     at Page._eachChildView (/data/data/org.nativescript.test/files/app/tns_modules/ui/page/page-common.js:286:9)
JS:     at Page.View._loadEachChildView (/data/data/org.nativescript.test/files/app/tns_modules/ui/core/view-common.js:739:18)
JS:     at Page.View.onLoaded (/data/data/org.nativescript.test/files/app/tns_modules/ui/core/view-common.js:729:14)
JS:     at Page.View.onLoaded (/data/data/org.nativescript.test/files/app/tns_modules/ui/core/view.js:82:35)
JS:     at Page.onLoaded (/data/data/org.nativescript.test/files/app/tns_modules/ui/page/page-common.js:53:35)
JS:     at eachChild (/data/data/org.nativescript.test/files/app/tns_modules/ui/core/view-common.js:736:23)
JS:     at ProxyViewContainer.LayoutBase._eachChildView (/data/data/org.nativescript.test/files/app/tns_modules/ui/layouts/layout-base-common.js:146:22)
JS: Error: Uncaught (in promise): TypeError: this.page.frame._getNavBarVisible is not a function

My setup is is exactly like in the example

Status Bar Color

If i used this plugin it always replicate me a error in android.Iam new to nativescript.plz suggest me the solutions

Works in VueJS too !!!

Here are the tips:

My page code:

<template>
    <Page class="page" 
        backgroundSpanUnderStatusBar="true"
        actionBarHidden="true">
        <StatusBar ios:barStyle="light" barColor="#23D5AB" />
        ...
    </Page>
</template>

Another tricks.js file that I import before in main.js with some tricks, workarounds and so on...

require("nativescript-vue").registerElement(
    "StatusBar",
    () => require("nativescript-statusbar").StatusBar
);

And that's it !!!

Crashing on both iOS and Android

Hi, I've installed the module and added the lines in the page.xml file:

<Page xmlns="http://schemas.nativescript.org/tns.xsd"  xmlns:x="nativescript-statusbar" navigatingTo="onNavigatingTo" class="page">
    <Page.actionBar>
        <ActionBar title="Settings" icon="" class="action-bar">
        </ActionBar>
    </Page.actionBar>
      <x:StatusBar ios:barStyle="light" android:barColor="#00C0F5" />
...

However, running the app I get the following error:
An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException:
Calling js method onMenuItemClick failed

Error: Building UI from XML. @file:///app/settings-page.xml:23:7

Module '/data/data/com.asouza.buddyFinder/files/app/nativescript-statusbar' not found for element 'nativescript-statusbar:StatusBar'.
com.tns.NativeScriptException: Failed to find module: "/data/data/com.asouza.buddyFinder/files/app/nativescript-statusbar", relative to: app//
com.tns.Module.resolvePathHelper(Module.java:146)
...

Any ideas on what I did wrong? I am running
│ nativescript │ 3.0.0
│ tns-core-modules │ 2.5.0
│ tns-android │ 3.0.0
│ tns-ios │ 2.5.0

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.