1

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

依赖项:@remobile/react-native-toast":"^1.0.7""react-native":"0.56.0"...

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

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

并且 toast 通知不会显示自己,即使它确实通过.catch().

谢谢你的帮助!

4

1 回答 1

0

你让他错了,试着让你的吐司像这样

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

于 2019-11-15T00:46:32.233 回答