software-mansion / react-native-screens

Native navigation primitives for your React Native app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Screen UI clipped when changing orientation from portrait to landscape

iamsaadMehmood opened this issue · comments

Description

When the user changes the orientation from portrait to landscape or landscape to portrait the UI clipped but after reloading the application the UI works perfectly

I have tried the following patch in RNSScreenStack.mm but it didn't work

- (void)navigationController:(UINavigationController *)navigationController
       didShowViewController:(UIViewController *)viewController
                    animated:(BOOL)animated
{
  [self emitOnFinishTransitioningEvent];
  [RNSScreenWindowTraits updateWindowTraits];
  [_controller.view setNeedsLayout]; <------- This line
}

The Following is the UI that I am getting after changing the orientation

Simulator Screenshot - iPad (10th generation) - 2023-12-28 at 12 55 29

Following is the UI which should be after changing the orientation

Simulator Screenshot - iPad (10th generation) - 2023-12-28 at 13 28 09

Tested on iPad (10th generation)
iOS 17.2.

Steps to reproduce

  1. Create Some UI that is different for landscape and portrait.
  2. Change the Device orientation from portrait to landscape or Landscape to portrait the UI will be clipped.

Snack or a link to a repository

can't share

Screens version

^3.29.0

React Native version

0.71.3

Platforms

Android, iOS

JavaScript runtime

None

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

iPad (10th Generation)

Acknowledgements

Yes

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

Hi @iamsaadMehmood, thanks for submitting this issue!
Do you know if this issue is related to the #1738? Is it the same problem?

Hi @iamsaadMehmood, thanks for submitting this issue! Do you know if this issue is related to the #1738? Is it the same problem?

Yes That's the same problem but the patch is not working anymore

@iamsaadMehmood Okay 👍 since we want to avoid duplicated issues in the repository, let me close this issue for now (let's move with the discussion there).
Once again, thanks for confirming this issue, I will try to fix that once I find the solution!