在 React-Native 中关闭警报 [英] Dismiss Alert in React-Native

查看:33
本文介绍了在 React-Native 中关闭警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以以编程方式从主应用程序本身消除 React-Native 中的 Alert?

I was wondering if it is possible to dismiss an Alert in React-Native from the main application itself, programmatically?

例如,我的应用程序显示了一个警报.当用户在该屏幕上停留一段时间并且应用程序的会话到期时,用户会被重定向到登录屏幕,但警报保持打开状态,我想在发生这种情况时将其关闭.

As an example, my application shows an Alert. When the user stays on that screen for a while and the session of the app expires, the user gets redirected to the login screen but the Alert stays open and I'd like to close it while this happen.

有没有办法做这样的事情?

Is there a way to do something like this?

谢谢

推荐答案

你不能.您必须使用自定义警报框或模式,然后在需要时关闭它.

You can't. You have to use a custom alert box or a modal and than close it if needed.

这篇关于在 React-Native 中关闭警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆