【问题标题】:Toast from (@remobile/react-native-toast) doesn't display来自(@remobile/react-native-toast)的吐司不显示
【发布时间】:2019-03-06 16:33:54
【问题描述】:

首先,问题出现在ios模拟器下(所有虚拟设备)。

依赖关系: @remobile/react-native-toast": "^1.0.7" “反应原生”:“0.56.0”...

问题描述: 我在这样的异步方法中模拟 api 错误:

async getData() {
 await MyApi.myMethod(...).catch(() => {
   Toast.showLongTop(myToastMessage);
 });
 // Here a toast would be displayed correctly
 }

即使通过.catch(),toast 通知也不会显示。

感谢您的帮助!

【问题讨论】:

    标签: react-native async-await toast catch-block


    【解决方案1】:

    你错了,试着把你的吐司变成这样

    ToastAndroid.show('HI world', ToastAndroid.SHORT);

    【讨论】:

      猜你喜欢
      • 2022-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-21
      • 1970-01-01
      • 2023-02-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多