Hi guys,
So, I have an issue where my app can be turned landscape on an Android phone and cause issue with layouts.
Firstly, I want to be able to stop the user rotating their device (phone) and lock them into using my app in a Portrait view only. My iOS app does this and it works great.
Secondly, the Tablet version can be rotated if the user desires and be used in both portrait and landscape modes. I have a listener on orientation change and that all works fine with different layouts for each orientation.
I've tried to follow the official docs, and it doesn't work.
I added this to my tiapp.xml
<activity android:name=".MyAppActivity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|screenSize"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:name="org.appcelerator.titanium.TiActivity" android:screenOrientation="userPortrait" android:configChanges="keyboardHidden|orientation|screenSize"/> <activity android:name="org.appcelerator.titanium.TiTranslucentActivity" android:screenOrientation="userPortrait" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@style/Theme.AppCompat.Translucent"/> <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity" android:screenOrientation="userPortrait" android:configChanges="screenSize"/> <activity android:name="ti.modules.titanium.media.TiCameraActivity" android:screenOrientation="userPortrait" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@style/Theme.AppCompat.Translucent.NoTitleBar.Fullscreen"/> <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16"/>I really don't want to have to manually declare every window orientation in the app itself, but I fear that may be the only way.
Is there a nice easy way of doing this? Help!