2

我在 Titanium 上做了一个应用程序。其在跨平台(android 或 iphone)上的工作。我想在 android 设备中停止方向我该怎么办?因为,android 有默认的方向改变。和iphone没有默认。

4

2 回答 2

3
win.orientationModes = [Ti.UI.PORTRAIT];

这是工作...

于 2012-03-01T16:11:58.917 回答
1

对于任何类型的 android 应用程序,您都可以在下面的 android manifest 中使用。

<activity android:screenOrientation="landscape" android:name="org.appcelerator.titanium.TiActivity" android:configChanges="keyboardHidden"/>

对于任何类型的 IOS 应用程序,您可以在以下 xcode 的主 plist 文件中使用

<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeRight</string>

特定于 Titanium Mobile;请查看以下来自 Titanium 开发中心的链接 http://developer.appcelerator.com/question/22241/is-there-a-way-to-disable-orientation-change-on-the-ipadiphone

于 2012-03-01T16:09:21.543 回答