项目作者: iamabs2001

项目描述 :
Nativescript Chrome Tabs Plugin for android & ios
高级语言: TypeScript
项目地址: git://github.com/iamabs2001/nativescript-chrome-tabs.git
创建时间: 2020-12-29T09:10:10Z
项目社区:https://github.com/iamabs2001/nativescript-chrome-tabs

开源协议:MIT License

下载


android" class="reference-link">Nativescript Chrome Tabs apple android

npm
GitHub
Build Status
npm
GitHub issues
Status
Twitter Follow

Chrome Tabs Plugin to open a custom chrome/safari tabs in android & ios.

Installation

  1. tns plugin add nativescript-chrome-tabs

Demo

Demo 1 Demo 2
Demo 3 Demo 4

Usage

  1. <Button text="click" (tap)="myCustomWeb();">

Javascript

  1. var { initChromeTab, openChromeTab } = require('nativescript-chrome-tabs');
  2. constructor() {
  3. initChromeTab();
  4. }
  5. function myCustomWeb() {
  6. openChromeTab({
  7. url: 'http://google.com',
  8. toolbarColor: '#0361cc',
  9. toolbarControlsColor: '#303F9F'
  10. });
  11. }

Typescript

  1. import { initChromeTab, openChromeTab } from "nativescript-chrome-tabs";
  2. constructor() {
  3. initChromeTab();
  4. }
  5. myCustomWeb() {
  6. openChromeTab({
  7. url: 'http://google.com',
  8. toolbarColor: '#0361cc',
  9. toolbarControlsColor: '#303F9F'
  10. });
  11. }

API (Properties)

Property Default Description
url required The URL to open
showTitle false Shows title bar in the webview
toolbarColor undefined Color of the toolbar
toolbarControlsColor undefined (only iOS) color of buttons on toolbar
isClosed undefined callback function that will be called when webview is closed

API (Methods)

Method Type Returns Description
initChromeTab(); constructor void To Initialize Chrome Tab
openChromeTab(url : String, toolbarColor : String, toolbarControlsColor : String); method void To Open a Chrome Tab

https://developer.chrome.com/docs/multidevice/android/customtabs/