admin管理员组

文章数量:1388805

In my app, some screens are in landscape mode, while others are in portrait mode.

My problem is:

First screen is in landscape mode and second screen is in portrait mode

When navigating from the first screen to the second screen, everything works fine. However, when navigating back from the second screen to the first screen, the first screen briefly appears in portrait mode before switching to landscape. This looks like a glitch.

This issue occurs only on iOS; on Android, it works fine.

video link for more clarity

Correct Behaviour should be, When navigating back to the second screen, it should immediately appear first screen in landscape mode without briefly switching to portrait.

The transition should be smooth and consistent on iOS.

package.json file

I have used 'react-native-orientation-locker' plugin for lock & unlocking the mode

 React.useEffect(() => {
Orientation.lockToLandscape();

return () => {
  Orientation.unlockAllOrientations();
};}, []);

本文标签: React native ios screen orientations change problemsStack Overflow