Comments (3)
Can you post the code you're using to do that?
from nativescript-statusbar.
It's a bit late, but I'm facing the same issue as well. I'm using NativeScript with Angular, and that might have something to do with it, but I've got a status bar compnent on both my home page and the other page:
home.component.ts
import { Component, OnInit } from "@angular/core";
import { RouterExtensions } from "nativescript-angular/router";
@Component({
selector: "Home",
moduleId: module.id,
templateUrl: "./home.component.html",
styleUrls: [ "./home.component.css" ]
})
export class HomeComponent implements OnInit {
constructor(private routerExtensions: RouterExtensions) {}
ngOnInit(): void {}
openCreateOrderPage() {
this.routerExtensions.navigate(["/other-page"], {
transition: {
name: "fade"
}
});
}
}
home.component.html
<StatusBar android:barStyle="#007BB3" ios:barStyle="dark"></StatusBar>
<ActionBar class="action-bar" title="Home"></ActionBar>
<DockLayout class="page">
<!-- blah blah -->
</DockLayout>
other-page.component.ts
import { Component, OnInit } from "@angular/core";
import { RouterExtensions } from "nativescript-angular/router";
@Component({
selector: "CreateOrder",
moduleId: module.id,
templateUrl: "./other-page.component.html",
styleUrls: [ "./other-page.component.css" ]
})
export class OtherPageComponent implements OnInit {
constructor(private routerExtensions: RouterExtensions) {}
ngOnInit(): void {}
back() {
this.routerExtensions.back();
}
}
other-page.component.html
<StatusBar android:barStyle="#D3D3D3" ios:barStyle="light"></StatusBar>
<ActionBar class="action-bar" title="Other Page">
<NavigationButton icon="res://ic_close_black" text="Back" (tap)="back()"></NavigationButton>
</ActionBar>
<StackLayout class="page">
<!-- something something -->
</StackLayout>
When going from Home -> Other Page, the status bar changes correctly, but when going back, it doesn't - it stays the same color. I registered the StatusBar element in the root app.component.ts
as well, and the routing is definitely hooked up correctly, and it does appear to be working in that sense, but I'm not sure what to do about the back button.
from nativescript-statusbar.
I realized it might have something to do with the fact that I use page-router-outlet
instead of router-outlet
, since the former doesn't regenerate a page when you go back to it. When I change it, the status bar works but the other sections of the page don't render. Plus, I heard this wasn't a best practice? I'm not sure however.
from nativescript-statusbar.
Related Issues (16)
- Does not change the status bar color on the first page (iOS) HOT 12
- Does this work with NNG2? HOT 1
- isnt compatible with webpack HOT 2
- Crashing on both iOS and Android HOT 1
- Status Bar Color
- can not hide a status bar
- Support for NS + Angular HOT 4
- Changing programmatically
- NativeScript 4 HOT 2
- Project is dead ? HOT 1
- After closing App status bar changes color to black
- Not working with Angular modals in Android
- Works in VueJS too !!! HOT 3
- forked into nativescript-systemui HOT 4
- Issue with Angular 10 Nativescript 7 Incompatibility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-statusbar.