
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
RNToast 功能类似于native-base的Toast,但是不同的是RNToast除了支持提示文字以外,还增加了图片的支持(android)。
npm i rntoast --save
import Toast from 'rntoast'
...
// other code
...
Toast.show({
content: 'text', //也可以是一个自定义的组件
duration: 2000,
shadow: true,
animation: false,
hideOnPress: false,
delayShow: 0,
type: "info",
confirm: true
})
Name | Type | Default | Description |
---|---|---|---|
animation | bool | true | 组件显示/隐藏时是否有动态效果 |
confirm | bool | false | 是否显示Toast隐藏按钮 |
confirmText | string | 'ok' | Toast按钮的文字内容 |
containerStyle | style | 显示内容的整体样式 | |
duration | number | 3000 | Toast的持续时间 |
position | number | 正数距离顶部距离,负数距离底部距离, 0居中 | |
opacity | number | 1 | Toast的透明度 |
textStyle | style | 传入Toast中的内容为string时有效 | |
delayShow | number | 0 | 点击后延迟多久显示Toast |
hideOnPress | bool | true | 点击Toast是否关闭Toast |
type | string | default | 支持success(#5cb85c)/info(#62B1F6)/error(#d9534f)/warning(#f0ad4e)/default(#999999) |
Name | Type | Default | Description |
---|---|---|---|
onHide | func | Toast关闭前调用 | |
onHidden | func | Toast关闭成功时调用 | |
onShow | func | Toast打开前调用 | |
onShown | func | Toast打开成功时调用 |
FAQs
A light tip that can be used on both android and iOS.
We found that rntoast demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.