Open ionictest2017 opened 8 months ago
here my code
function OnEnterHandleFullscreen() { console.log('OnEnterHandleFullscreen') if (isMobilePlatform) state.fullscreen ? Orientation.unlockAllOrientations() : Orientation.lockToLandscapeLeft(); }
function OnExitHandleFullscreen() { console.log('OnExitHandleFullscreen') if (isMobilePlatform) { setState({...state, fullscreen: false}); } }
{!Platform.isTV && Platform.OS !== 'web' && ( <OrientationLocker orientation={state.fullscreen ? LANDSCAPE : PORTRAIT} onChange={orientation => { console.log('--orientation fullscreen--',state.fullscreen) if (orientation !== PORTRAIT) { setState({...state, fullscreen: true}); } else { setState({...state, fullscreen: false}); } }} onDeviceChange={orientation => console.log('onDeviceChange', orientation) } /> )}
"react-native-orientation-locker": "^1.6.0",
@ionictest2017 Could you please format your code to be easy to read, so that we could troubleshoot for you?
here my code
function OnEnterHandleFullscreen() { console.log('OnEnterHandleFullscreen') if (isMobilePlatform) state.fullscreen ? Orientation.unlockAllOrientations() : Orientation.lockToLandscapeLeft(); }
function OnExitHandleFullscreen() { console.log('OnExitHandleFullscreen') if (isMobilePlatform) { setState({...state, fullscreen: false}); } }
{!Platform.isTV && Platform.OS !== 'web' && ( <OrientationLocker orientation={state.fullscreen ? LANDSCAPE : PORTRAIT} onChange={orientation => { console.log('--orientation fullscreen--',state.fullscreen) if (orientation !== PORTRAIT) { setState({...state, fullscreen: true}); } else { setState({...state, fullscreen: false}); } }} onDeviceChange={orientation => console.log('onDeviceChange', orientation) } /> )}
"react-native-orientation-locker": "^1.6.0",