react-native-image-viewer - Landscape view doesn't work on IOS


Suther

On Android, landscape mode works like a charm, but on IO I found the following issues:

Mobile device is in landscape mode:

  • I click on an image (Touchable-Opacity set state modalShow Landscape-Mode will switch to Portrait-Mode after which Modal appears
  • If I close the modal, the app switches back to landscape mode.

Any idea why this only happens on Iphone but works fine on Android?

Suther

You have to add this (or just some of them as needed) to your Modal, which wraps the Image-Zoom component:

supportedOrientations={
 [
   'portrait', 
   'portrait-upside-down', 
   'landscape', 
   'landscape-left', 
   'landscape-right'
 ]
}

Related


react-native-image-viewer - Landscape view doesn't work on IOS

Suther On Android, landscape mode works like a charm, but on IO I found the following issues: Mobile device is in landscape mode: I click on an image (Touchable-Opacity set state modalShow Landscape-Mode will switch to Portrait-Mode after which Modal appears I

Uploading image using fetch doesn't work in React Native (iOS)

Ikuhisa I'm developing a mobile app with React Native, but posting images on iOS doesn't work. I have connected my code to requestbin, set up info.plist to allow non-https urls and other post requests are working (eg login). For images, all I get is a blank bo

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

justifyContent doesn't work with View React Native

golden nerd For some reason, in this view, the proof content tag doesn't work for my view? I tried applying it in the modalScreen view but that didn't work either. Any ideas? function BottomPopup() { return ( <View style={styles.modalScreen}> <View

justifyContent doesn't work with View React Native

golden nerd For some reason, in this view, the proof content tag doesn't work for my view? I tried applying it in the modalScreen view but that didn't work either. Any ideas? function BottomPopup() { return ( <View style={styles.modalScreen}> <View

justifyContent doesn't work with View React Native

golden nerd For some reason, in this view, the proof content tag doesn't work for my view? I tried applying it in the modalScreen view but that didn't work either. Any ideas? function BottomPopup() { return ( <View style={styles.modalScreen}> <View

react native: importing image doesn't work

war commander I can't import images into my component. I saved the image in a file called WidgetImagesand Images.jswrote the following code in it to import it: var Images = { Weather: require('./WidgetsImages/Weather.png'), News: require('./WidgetsImag

Drag and drop image in landscape doesn't work

Amadeu Andrade I have the following code to drag and drop one image onto another. import Foundation import UIKit class DragImg: UIImageView { var originalPosition: CGPoint! var dropTarget: UIView? override init(frame: CGRect) { super.ini

Drag and drop image in landscape doesn't work

Amadeu Andrade I have the following code to drag and drop one image onto another. import Foundation import UIKit class DragImg: UIImageView { var originalPosition: CGPoint! var dropTarget: UIView? override init(frame: CGRect) { super.ini

Drag and drop image in landscape doesn't work

Amadeu Andrade I have the following code to drag and drop one image onto another. import Foundation import UIKit class DragImg: UIImageView { var originalPosition: CGPoint! var dropTarget: UIView? override init(frame: CGRect) { super.ini

const i = new Image(); doesn't work on native iOS and Android

Dimitri Kopriwa I am getting the following error in react-native: [Unhandled promise rejection: ReferenceError: Can't find variable: Image] * src/utils/b64ToBlob.js:45:56 in Promise$argument_0 Here is the function where it fails b64ToBlog.js: export const get

const i = new Image(); doesn't work on native iOS and Android

Dimitri Kopriwa I am getting the following error in react-native: [Unhandled promise rejection: ReferenceError: Can't find variable: Image] * src/utils/b64ToBlob.js:45:56 in Promise$argument_0 Here is the function where it fails b64ToBlog.js: export const get

const i = new Image(); doesn't work on native iOS and Android

Dimitri Kopriwa I am getting the following error in react-native: [Unhandled promise rejection: ReferenceError: Can't find variable: Image] * src/utils/b64ToBlob.js:45:56 in Promise$argument_0 Here is the function where it fails b64ToBlog.js: export const get

const i = new Image(); doesn't work on native iOS and Android

Dimitri Kopriwa I am getting the following error in react-native: [Unhandled promise rejection: ReferenceError: Can't find variable: Image] * src/utils/b64ToBlob.js:45:56 in Promise$argument_0 Here is the function where it fails b64ToBlog.js: export const get

const i = new Image(); doesn't work on native iOS and Android

Dimitri Kopriwa I am getting the following error in react-native: [Unhandled promise rejection: ReferenceError: Can't find variable: Image] * src/utils/b64ToBlob.js:45:56 in Promise$argument_0 Here is the function where it fails b64ToBlog.js: export const get