wonday / react-native-orientation-locker

A react-native module that can listen on orientation changing of device, get current orientation, lock to preferred orientation.
MIT License
761 stars 274 forks source link

When switching from portrait to landscape then slight space left using version 1.5.0. Also cannot update #289

Open Asharuddin-90 opened 9 months ago

Asharuddin-90 commented 9 months ago

media_20240228_125155_7607707875810082966 media_20240228_125155_7613300781130159606 How to fix this space when switching from portrait to landscape then getting this space if landscape-left then left side space is there or if landscape-right then right side space is there.

useDeviceOrientationChange((ori) => { setOrientation(ori); // This will trigger a re-render if (ori === "LANDSCAPE-RIGHT" || ori === "LANDSCAPE-LEFT") { if (state.index === 1) { Orientation.unlockAllOrientations(); } } else if (ori === "UNKNOWN" || ori === "FACE-UP") { // No action needed for these cases null; } else if (ori === "PORTRAIT-UPSIDEDOWN") { Orientation.lockToPortrait(); } else { // Lock to portrait if not in landscape mode or unknown Orientation.lockToPortrait(); } });

RuFang-21 commented 7 months ago

Hello guys , Any solution for this?

Nairi85 commented 5 months ago

I have same issue. Is there any solution??

lvnini commented 4 months ago

+1