最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

React native ios screen orientations change problems - Stack Overflow

programmeradmin5浏览0评论

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();
};}, []);
发布评论

评论列表(0)

  1. 暂无评论