Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I developed a mobile Expo React Native App and I need to build a web version. When I try to run the app on web, I noticed that the components are rendering "rotated". That is, the width is the height and vice versa. I can't just switch the values due to large amount of components and flex styling. By checking web orientation it's say that is "portrait" and the app default orientation is "landscape", that's explain the problem.

According to Expo Orientation Documentation, I should be able to "rotate" the web screen with:

ScreenOrientation.lockPlatformAsync(ScreenOrientation.WebOrientationLock.LANDSCAPE);

But I got this error:

TypeError: lockPlatformAsync cannot be called with undefined option properties

I also tryied to change app.json "orientation" value to "landscape", but this also doesn't worked.

Any suggestions?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.5k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...