i’m using ScreenRotation but like i already explained in https://github.com/expo/expo/issues/902#issuecomment-467456413
ScreenOrientation.Landscape won’t lock, it shows correctly but it change to portrait automatically after a brief periode
ChartScreen.js
import React, { Component } from 'react';
import {
View,
StyleSheet,
Dimensions,
Text,
} from 'react-native';
import { ScreenOrientation } from 'expo';
export default class ChartScreen extends Component {
componentDidMount() {
ScreenOrientation.allowAsync(ScreenOrientation.Orientation.LANDSCAPE);
this.setState({ dataChart: this.getData() });
}
switchToLandscape() {
ScreenOrientation.allowAsync(ScreenOrientation.Orientation.LANDSCAPE);
}
render() {
this.switchToLandscape();
return (
<View style={styles.container}>
<Text>test if lock on landscape is working</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'flex-end',
backgroundColor: '#f5fcff',
},
});
is there something wrong with my code, because i tried every thing but it does not seem to lock on landscape ?