How do I keep my mobile AIR application on landscape mode?

自作多情 提交于 2019-12-11 18:36:48

问题


I can't seem to find any way to force it to go landscape mode all the time. When I go to MyApp-app.xml and edit the <aspectRatio></aspectRatio> tags to landscape, only the main view is landscaped. If I navigate to the second view, it turns back to portrait. Any help?


回答1:


You can set it on Properties of the Document. Go to File>Publish Settings> Click on Configuration Player ("Air for Android", "Air for iOS", "Flash Player 11", etc). Now, mark the "Auto Orietation".

Like this:

Now, save, and Test.




回答2:


Devices could be a huge factor in this. What device are you having the problem on?

That said, in addition to setting aspectRatio to landscape I would try to set autoOrients to false:

    <!-- The initial aspect ratio of the app when launched (either "portrait" or "landscape"). Optional. Mobile only. Default is the natural orientation of the device -->
    <aspectRatio>landscape</aspectRatio>

    <!-- Whether the app will begin auto-orienting on launch. Optional. Mobile only. Default false -->
    <autoOrients>false</autoOrients>


来源:https://stackoverflow.com/questions/9248030/how-do-i-keep-my-mobile-air-application-on-landscape-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!