nativeScript-playground-bar
设置 NativeScript 的 Playground 中的状态栏为浅色或深色内容。
npm i --save nativescript-playground-bar

nativeScript-playground-bar

为您的 NativeScript Playground 项目提供一个插件,以帮助实现浅色或深色内容的状态栏。

安装

  1. Playground UI 选择 添加 NPM 包 (通过资源管理器弹出菜单)
  2. nativescript-playground-bar 作为 NPM 包名 输入。
  3. 点击 添加

用法

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

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

方法

lightContent

iOS 状态栏设置为浅色内容。

参数 必需 默认 描述
page yes n/a 您想要更改状态栏的当前页面。
timeout no 10 指定延迟更改样式的 (以毫秒为单位的时间)

darkContent

iOS 状态栏设置为深色内容,这是 Playgrounds 的默认样式。

参数 必需 默认 描述
page yes n/a 您想要更改状态栏的当前页面。
timeout no 10 指定延迟更改样式的 (以毫秒为单位的时间)