函数:getOrientation 获取屏幕方向
函数名称:获取屏幕方向
函数功能:获取屏幕是横屏还是竖屏
函数方法
rotate = getOrientation();
必填
无
选填
无
返回值
返回值 | 类型 | 说明 |
---|---|---|
rotate | number | 屏幕方向,1 - 横屏;2 - 竖屏 |
函数用例
--此函数仅支持 iOS
rotate = getOrientation();
if rotate == 1 then
nLog("横屏")
else
nLog("竖屏")
end