0

The requirement of my app is, it should provide both landscape and portrait mode on android tablet. But it should only allow portrait mode on android device. By adding this lineandroid:screenOrientation="portrait" landscape mode will be disabled on both and by removing this line, landscape mode will be enabled on both. Any solution?

STBox
  • 583
  • 8
  • 23
  • You will need to write a tiny bit of Java code, but yes you can do it. See https://stackoverflow.com/questions/9627774/android-allow-portrait-and-landscape-for-tablets-but-force-portrait-on-phone I'll keep this open in case someone can give you a more react native-y way to do it. – Gabe Sechan Nov 24 '21 at 07:17
  • If your current version of react-navigation is V6 then you can do it with this parameter in navigation screen, options={{orientation: isTab ? 'landscape' : 'portrait'}}. – Jay Nov 26 '21 at 12:32

0 Answers0