react-native-image-viewing icon indicating copy to clipboard operation
react-native-image-viewing copied to clipboard

no orientation support for android and ios

Open kalyanijamunkar10 opened this issue 4 years ago • 3 comments

images shows incorrectly in landscape mode

kalyanijamunkar10 avatar Jun 11 '20 11:06 kalyanijamunkar10

In my tests, even tough all my app reorients itself when in landscape mode, the <ImageView> continues to be rendered in portrait mode

feliperaul avatar Jul 30 '20 17:07 feliperaul

@feliperaul try using react-native's Modal with react-native-image-zoom-viewer. This worked for me. you need to add supportedOrientations={['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right']} in Modal.

kalyanijamunkar10 avatar Jul 31 '20 06:07 kalyanijamunkar10

If you need orientation support, you can use react-native-zoom-viewer like this.

<Modal visible={visible}>
      <ImageViewer
        renderIndicator={() => null}
        onSwipeDown={() => setIsVisible(false)}
        maxOverflow={0}
        renderHeader={() => (
          <Pressable
            alignSelf="flex-end"
            right={4}
            top={20}
            zIndex={1}
            position="absolute"
            onPress={() => setIsVisible(false)}
          >
            <Icon
              name="white-cross-new"
              alt="white-cross-new"
              height={32}
              width={32}
            />
          </Pressable>
        )}
        enableSwipeDown={true}
        imageUrls={[
          {
            url: imageUrl,
            props: {
              style: {
                transform: [{ rotate: "90deg" }],
              },
            },
          },
        ]}
      />
    </Modal>

sakshya73 avatar Feb 28 '22 13:02 sakshya73