1.2.0 • Published 2 years ago

react-native-mtoast v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React-Native-mToast

npm version

react native native toast

针对 react native 中 toast 无法覆盖 Modal 的问题,新增了此库解决上述问题。

Android 基于 GrenderG/Toasty

iOS 基于 scalessec/Toast

感谢 react-native-toasty

安装

npm i react-native-mtoast -E

使用

import Toast from "react-native-mtoast";

Toast.show(options: {
    /**
     * 消息内容
     */
    title: string;
    /**
     * 消息字体大小
     */
    titleSize?: number;
    /**
     * 消息字体颜色
     */
    titleColor?: string;
    /**
     * 显示时长
     * 0: SHORT; 1: LONG
     */
    duration?: 0 | 1;
    /**
     * 吐司背景色
     */
    tintColor?: string;
    /**
     * 显示位置
     */
    position?: 'top' | 'center' | 'bottom';
    /**
     * Android only
     */
    offsetX?: number;
    /**
     * Android only
     */
    offsetY?: number;
})

License

MIT