我正在尝试拥有一个类似 Snapchat 故事的功能,其中显示一组图片并持续几秒钟,然后返回上一个导航。类似于以下内容:if (props.length > 0) { let timeout; if (props.length - 1 === index) { clearTimeout(timeout) navigation.goBack() } if (props[index].image) { timeout = setTimeout(() => { setIndex(index + 1) }, 3000) return <Image source={{ uri: props[index].image }} style={{ flex: 1 }} /> }}但是,这显示出不可预测的结果。
添加回答
举报
0/150
提交
取消
