Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
指针事件在Ios上不起作用_Ios_React Native_Pointer Events - Fatal编程技术网

指针事件在Ios上不起作用

指针事件在Ios上不起作用,ios,react-native,pointer-events,Ios,React Native,Pointer Events,我在背景上有一个地图视图,它上面有一个带有不同图标的底页,在向上滑动时,我通过使指针事件值为“无”来禁用地图视图。 下面是代码,它在android上运行良好,但在我删除指针事件之前,地图视图不接受任何事件。我试着不给任何或自动直接,但它不工作 Code Starts Here toggleBackground = (status) => { this.setState({ enableBackground: status })

我在背景上有一个地图视图,它上面有一个带有不同图标的底页,在向上滑动时,我通过使指针事件值为“无”来禁用地图视图。 下面是代码,它在android上运行良好,但在我删除指针事件之前,地图视图不接受任何事件。我试着不给任何或自动直接,但它不工作

Code Starts Here


toggleBackground = (status) => {
        this.setState({
            enableBackground: status
        })

}
// this is the render method 
// here i am using bottom sheet and map view 
return (

            <View style={{
                flex: 1,
                backgroundColor: '#2c2c2f'//added background color, because bottom sheet doesn't appear on android otherwise
            }}>

                <BottomSheetBehavior

                    // snapPoints={[300, BOTTOM_SHEET_MAX_HEIGHT]}
                    snapPoints={this.state.sheetSnapPoints}
                    ref={this.bottomSheetRef}
                    renderContent={this.renderInner}
                    // renderHeader={this.renderHeader}
                    initialSnap={0}
                    callbackNode={this.fall}
                    enabledInnerScrolling={true}
                    // enabledInnerScrolling={false}
                    enabledGestureInteraction={true}
                    // enabledBottomClamp={true}//for locking snapping in bottom 
                    // enabledContentGestureInteraction={false}

                    // enabledGestureInteraction={this.state.enableTapping}//using this to lock manual swiping of bottomsheet

                    enabledContentTapInteraction={false}//because clicks on TouchableOpcaity were not working in android
                    onOpenStart={() => {
                        this.toggleBackground(false)
                    }}
                    onCloseEnd={() => {
                        this.toggleBackground(true)
                    }}
                />

                <Animated.View
                    style={{
                        alignItems: 'center',
                        opacity: Animated.add(0.1, Animated.multiply(this.fall, 0.9))

                    }} >

                    <View
                        style={{
                            width: width,
                            // height: height, 
                            height: Platform.OS == 'ios' ? height :
                                (StatusBar.currentHeight > 24 ? height + StatusBar.currentHeight : height),
                        }}>

                        <MapView
                            // customMapStyle={MAP_STYLE}
                            style={{ flex: 1, }}
                            provider={PROVIDER_GOOGLE}
                            followsUserLocation={true}
                            showsCompass={false}
                            mapType={this.state.selectedMapType}
                            showsMyLocationButton={false}
                            ref={component => this._map = component}
                            onRegionChangeComplete={(region) => { this.onRegionChangeComplete(region) }}
                            // initialRegion={{
                            //     latitude: this.props.navigation.getParam('lat', 25.198535),
                            //     longitude: this.props.navigation.getParam('lng', 55.277923),
                            //     latitudeDelta: 0.0030, longitudeDelta: 0.0030
                            // }}
                            pointerEvents={this.state.enableBackground ? 'auto' : 'none'}

                            initialCamera={{
                                center: {
                                    latitude: this.props.navigation.getParam('lat', 25.198535),
                                    longitude: this.props.navigation.getParam('lng', 55.277923),

                                },
                                zoom: 18,
                                pitch: 0,
                                heading: 0,
                                altitude: 0,
                            }}
                            showsUserLocation={true} />


                        {
                            !this.state.enableBackground &&



                            <TouchableWithoutFeedback

                                onPress={() => {
                                    this.bottomSheetRef.current.snapTo(0)
                                }}
                            ><View

                                style={{
                                    flex: 1,
                                    position: "absolute",
                                    top: 0,
                                    left: 0,
                                    right: 0,
                                    bottom: 0,
                                    elevation: 14

                                }}></View></TouchableWithoutFeedback>



                        }





                       </View>

                </Animated.View>

            </View>
        );
代码从这里开始
toggleBackground=(状态)=>{
这是我的国家({
启用背景:状态
})
}
//这是渲染方法
//在这里,我使用的是底部图纸和地图视图
返回(

欢迎来到SO。请看一看,了解如何提供有用的代码。无意冒犯!欢迎来到SO。请看一看,了解如何提供有用的代码。无意冒犯!