Android 判断方向是否锁定可以读取配置 Settings.System.ACCELEROMETER_ROTATION
请问在IOS上有没有什么简单的方式获取到屏幕方向是否锁定呢?
开发环境: react-native
https://segmentfault.com/q/10...
###1.用个第三方库 react-native-orientation
2.简单方式
import { Dimensions } from 'react-native';
Dimensions.addEventListener('change', ()=>{
const dim = Dimensions.get('screen');
// dim.height >= dim.width?'portrait':'landscape';
});