[英]How do I keep my mobile AIR application on landscape mode?
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. 当我转到MyApp-app.xml并将<aspectRatio></aspectRatio>
标记编辑为landscape时 ,只有主视图才变为水平。 If I navigate to the second view, it turns back to portrait . 如果我导航到第二个视图,它会返回到portrait 。 Any help? 有什么帮助吗?
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). 转到“文件”>“发布设置”>单击配置播放器(“ Air for Android”,“ Air for iOS”,“ Flash Player 11”等)。 Now, mark the "Auto Orietation". 现在,标记“自动排列”。
Like this: 像这样:
Now, save, and Test. 现在,保存并测试。
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: 也就是说,除了将aspectRatio设置为landscape外,我还将尝试将autoOrients设置为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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.