npm i --save nativescript-toasts
- 版本:1.0.3
- GitHub: https://github.com/mdanishs/nativescript-toasts
- NPM: https://npmjs.net.cn/package/nativescript-toasts
- 下载
- 昨天: 0
- 上周: 0
- 上个月: 0
nativeScript-toasts
此插件为 Android 和 iOS 提供了在 NativeScript 应用程序中显示 toast 通知的通用 API。
安装
tns plugin add nativescript-toasts
如何使用
var nstoasts = require("nativescript-toasts");
var options = {
text: "Hello World",
duration : nstoasts.DURATION.SHORT,
position : nstoasts.POSITION.TOP //optional
}
nstoasts.show(options);
此插件使用第三方库进行 iOS 开发
插件使用由 Charles Scalesse 创建的 pod 在 iOS 上显示 toast
https://cocoapods.org.cn/pods/Toast
Typescript 用户
import * as Toast from 'nativescript-toasts';
let toastOptions:Toast.ToastOptions = {text: "Hello World", dutation: Toast.DURATION.SHORT};
Toast.show(toastOptions);