gpt4 book ai didi

javascript - 在 React Native 中加载 ActivityIndi​​cator 时如何禁用触摸屏?

转载 作者:行者123 更新时间:2023-11-28 23:42:39 25 4
gpt4 key购买 nike

我想在加载时禁用触摸屏(我使用 ActivityIndi​​cator)。我输入了 pointerEvents = {'none} 但它不起作用。你能给我一个解决方案吗?

import React from "react";
import { TouchableWithoutFeedback, View, ActivityIndicator } from "react-native";
import Colors from "../../resources/colors/Colors";

const AppProgress = () => (
<View pointerEvents={"none"}
style={{
width: "100%",
height: "100%",
backgroundColor: Colors.dimBlack,
position: "absolute",
alignSelf: "center",
justifyContent: "center",
alignItems: "center"
}}>
<ActivityIndicator size="large" color={Colors.green}/>
</View>
);

export default AppProgress;

版本:

react: 16.4.1 => 16.4.1
react-native: 0.56.0 => 0.56.0

最佳答案

你已经正确地完成了每件事,你可以在 View 样式中尝试高值的 zIndex,因为其他 View 可能与它重叠。

关于javascript - 在 React Native 中加载 ActivityIndi​​cator 时如何禁用触摸屏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53095756/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com