1.用个第三方库 react-native-orientation
2.简单方式
import { Dimensions } from 'react-native';
Dimensions.addEventListener('change', ()=>{
const dim = Dimensions.get('screen');
// dim.height >= dim.width?'portrait':'landscape';
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…