Javascript 在React Native中加载ActivityIndicator时,如何禁用触摸屏?
我想在使用ActivityIndicator加载时禁用触摸屏。我把pointerEvents={'none}放进去了,但它不起作用。你能给我一个解决办法吗Javascript 在React Native中加载ActivityIndicator时,如何禁用触摸屏?,javascript,android,ios,reactjs,react-native,Javascript,Android,Ios,Reactjs,React Native,我想在使用ActivityIndicator加载时禁用触摸屏。我把pointerEvents={'none}放进去了,但它不起作用。你能给我一个解决办法吗 import React from "react"; import { TouchableWithoutFeedback, View, ActivityIndicator } from "react-native"; import Colors from "../../resources/colors/Colors"; const AppP
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;
版本:
反应:16.4.1=>16.4.1
反应本机:0.56.0=>0.56.0
您已经正确地完成了每一件事情,只是可以尝试在视图样式中使用高值的zIndex,因为其他视图可能会重叠它
export const OverLayLoading = () => {
return(
<View style = {styles.overlayLoadingContainer}>
<ActivityIndicator
size={50}
animating={true}
/>
</View>
)
};
overlayLoadingContainer:{
position: 'absolute',
top: 0,
bottom: 0,
right: 0,
left: 0,
justifyContent:'center',
alignItems:'center',
zIndex: 1,
backgroundColor: 'black'
},