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();
}
});
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(); } });