Reputation: 47
I facing some problem with TouchableOpacity...it works perfectly on ios but not android. I'm very sure that i import from "react-native" Not "react-native-gesture-handler".
Then i change to use TouchableHighlight from "react-native-gesture-handler" , remove the one from react-native and its works. But still TouchableOpacity cannot be use either from "react-native" or "react-native-gesture-handler".
I never put both "react-native" or "react-native-gesture-handler" at the same time because every time i try to change i will comment out one of them
I'm stuck now because other screen works perfectly.
It only happen in this modal screen (below). Can anybody please advice me?
tq
<Modal
visible={cameraVisible}
animationType="slide"
style={styles.modal}
transparent={false}
>
<SafeAreaView>
<Button title="Close" onPress={() => setCameraVisible(false)} />
</SafeAreaView>
<Camera
style={styles.camera}
type={type}
ref={(r) => {
camera = r;
}}
/>
<View
style={{
flexDirection: "row",
width: screenWidth,
height: 60,
backgroundColor: "white",
justifyContent: "space-around",
alignItems: "center",
}}
>
<TouchableOpacity
onPress={() => {
setType(
type === Camera.Constants.Type.back
? Camera.Constants.Type.front
: Camera.Constants.Type.back
);
}}
>
<Icon name={"camera-retake"} size={40} color="#076bf7" />
</TouchableOpacity>
<TouchableOpacity onPress={() => _takePicture(cameraId1)}>
<Icon name={"camera-iris"} size={40} color="#076bf7" />
</TouchableOpacity>
</View>
</Modal>
Upvotes: 1
Views: 1299