Skip to content

Instantly share code, notes, and snippets.

@greg-nagy
Created May 18, 2017 16:29
Show Gist options
  • Save greg-nagy/857f1100f11f079e4d9de59fbdc23151 to your computer and use it in GitHub Desktop.
Save greg-nagy/857f1100f11f079e4d9de59fbdc23151 to your computer and use it in GitHub Desktop.
Android status bar is still light
import {Component} from "@angular/core";
import {isIOS} from "tns-core-modules/platform";
import {topmost} from "tns-core-modules/ui/frame";
import * as app from 'application';
declare var android;
@Component({
selector: "ns-app",
templateUrl: "app.component.html",
})
export class AppComponent {
constructor() {
if (isIOS) {
topmost().ios.controller.navigationBar.barStyle = 1;
} else {
let decorView = app.android.startActivity.getWindow().getDecorView();
decorView.setSystemUiVisibility(android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment