air android应用程序始终以纵向模式启动,无论android设备的手持方式如何(横向/纵向)
我有一个AIR安卓应用程序,我正在安卓设备上运行(三星标签)。 我希望当用户启动应用程序时,在横向模式下放置应用程序(纵向模式也是如此) 但AIR应用程序总是以纵向模式启动,而不管设备的手持方式如何 我尝试了以下方法-air android应用程序始终以纵向模式启动,无论android设备的手持方式如何(横向/纵向),android,flash,actionscript-3,actionscript,air,Android,Flash,Actionscript 3,Actionscript,Air,我有一个AIR安卓应用程序,我正在安卓设备上运行(三星标签)。 我希望当用户启动应用程序时,在横向模式下放置应用程序(纵向模式也是如此) 但AIR应用程序总是以纵向模式启动,而不管设备的手持方式如何 我尝试了以下方法- 使用stage.deviceorientation(但当应用程序启动时(在应用程序完成通知后),该值未知) 使用阶段调整事件大小。(这会在启动时触发,不需要手动调整大小-但值基于纵向模式-宽度为600,高度为1024(应以其他方式调整)) 当我尝试改变设备的方向时,我得到了正确的
getResources().getConfiguration().orientation
即使我没有答案。。。我只想指出。。。阮的回答完全不相关。。。这个问题是关于AIR的,而不是本地Android开发人员
虽然。。。您可能希望查看stage.orientation而不是stage.deviceOrientation,请在应用程序激活处理程序中尝试以下操作:
NativeApplication.nativeApplication.addEventListener(flash.events.Event.ACTIVATE, function (e:*):void{
if(stage.orientation == StageOrientation.UNKNOWN){
stage.setOrientation(StageOrientation.ROTATED_LEFT);
}
});
NativeApplication.nativeApplication.addEventListener(flash.events.Event.ACTIVATE, function (e:*):void{
if(stage.orientation == StageOrientation.UNKNOWN){
stage.setOrientation(StageOrientation.ROTATED_LEFT);
}
});