adamgf / react-native-opencv3

react-native-opencv3 wraps functionality from OpenCV Java SDK 3.4.4 + contrib modules and iOS OpenCV 3.4.1 + contrib modules for use in React-Native apps. Please enjoy!
Other
191 stars 64 forks source link

CvCamera size when using navigation #33

Open Albert-vill opened 3 years ago

Albert-vill commented 3 years ago

Hello, I´m trying to understand why using react navigator on my app is messing with the size of the CvCamera component.

I have defined a basic structure with the form of:
  <NavigationContainer>
      <Stack.Navigator
        initialRouteName="Camera"
        screenOptions={{headerShown: false}}>
        <Stack.Screen name="Camera" component={CustomCamera} />
      </Stack.Navigator>
    </NavigationContainer>

But when i open the camera screen the size is reduced. Which is something that doesnt happen if i simply open the camera. I am using this stylesheet:

const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', position: 'absolute', width: '100%', height: '100%', }, preview: { alignItems: 'center', position: 'absolute', }, });

the framewidth and frameheight have a value of: 1280 and 960 and I am running the app on a Pixel 4 XL emulator from android studio.

This is the size of the camera when using navigation:

image

and this is the same when i dont use navigation:

image

adamgf commented 3 years ago

Hi @AlbertVC, Can you please fix this? I added you as a collaborator to react-native-opencv3 and react-native-opencv3-tests. I do not know react-native layout stuff well enough to fix this kind of stuff. Best regards, Adam