How do I set the screen orientation to portrait开发者_开发技巧 only on Android device using Titanium Studio?
There is an example project in the KitchenSink; Phone -> Orientation -> "Allow Landscape Only"
This works with SDK 1.8.2:
Create directory platform/android/
in your project directory. Find AndroidManifest.xml in build/android/ , copy and save it in platform/android/
.
Edit platform/android/AndroidManifest.xml and replace all values of 'android:configChanges' attribute to :
android:configChanges="keyboardHidden"
and add 'android:screenOrientation' attribute in all 'activity' tags.
android:screenOrientation="portrait"
精彩评论