nativescript-playground-bar

Set the status bar in NativeScripts' Playground to light or dark content.

Usage no npm install needed!

<script type="module">
  import nativescriptPlaygroundBar from 'https://cdn.skypack.dev/nativescript-playground-bar';
</script>

README

nativescript-playground-bar

A plugin for your NativeScript Playground projects to help implement a light or dark content status bar.

Installation

  1. From the Playground UI select Add NPM package (via the Explorer popup menu).
  2. Enter nativescript-playground-bar as the NPM package name.
  3. Click Add.

Usage

// main-page.js
const PlaygroundBar = require("~/nativescript-playgroundbar");

exports.pageLoaded = function (args) {
  PlaygroundBar.lightContent(args.object);
}

Methods

lightContent

Sets the iOS status bar to light content.

Arguments Required Default Description
page yes n/a The current page with the status bar you want to change.
timeout no 10 Specifies the time (in milliseconds) you want to delay the change of style.

darkContent

Sets the iOS status bar to dark content, which is the playgrounds default style.

Arguments Required Default Description
page yes n/a The current page with the status bar you want to change.
timeout no 10 Specifies the time (in milliseconds) you want to delay the change of style.