我制作的应用程序有四个tabas,一个使用相机功能。
此标签需要portlait / landscape。 其他三个选项卡仅使用porlait模式。
现在我为iOS设置了这样的
在tiapp.xml中
{ jKu1zHufqvPqUHZhtb1Jp: '
{
"cookie": {
"originalMaxAge": 14400000,
"expires": "2016-03-23T18:11:28.009Z",
"secure": false,
"httpOnly": true,
"path": "/"
},
"passport": {
"user": {
"id": 11,
"firstName": null,
"lastName": null,
"email": "a@b.c",
"password": ....
etc
}
}
}'}
然后在app.js
强制这样的方向。
<ios>
<plist>
<dict>
<key>UISupportedInterfaceOrientations~iphone</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
</ios>
它完美无缺。 即使我持有iPhone风景并启动应用程序,启动画面也被迫进行移植模式。
现在我想在Android中做同样的事情
在tiapp.xml中
我这样设定。
tabWin1.orientationModes = [Ti.UI.PORTRAIT];
tabWin2.orientationModes = [Ti.UI.PORTRAIT];
tabWin3.orientationModes = [Ti.UI.PORTRAIT];
tabWin4.orientationModes = [Ti.UI.PORTRAIT,Ti.UI.LANDSCAPE_RIGHT,Ti.UI.LANDSCAPE_LEFT];
然而,它并没有强制启动屏幕处于portlait模式。
我该如何解决?
答案 0 :(得分:2)
如果您想在纵向模式下锁定启动画面,则必须锁定Android活动(请按照以下步骤操作:http://bencoding.com/2016/02/11/android-orientation-locking-for-titanium/)。
但是!如果您这样做,整个应用程序将锁定在纵向。我不认为有可能在纵向模式下锁定启动画面并将窗口设置为横向模式(在此解释:http://docs.appcelerator.com/platform/latest/#!/guide/Orientation-section-29004932_Orientation-LimitingorientationmodesonAndroid)