Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

Ti.Platform.displayCaps.getPlatformWidth() returning height and vice versa on Android if locked Portrait

$
0
0

I've locked my Android screen orientation to portrait via the TiApp.xml (also tried using the tss files)

<android xmlns:android="http://schemas.android.com/apk/res/android">
        <tool-api-level>18</tool-api-level>
        <manifest android:versionCode="2" android:versionName="1.1">
            <supports-screens android:anyDensity="false"/>
            <!--android:largeScreens="true" android:normalScreens="true"
                android:smallScreens="false" android:xlargeScreens="false"/-->
            <application>
                <activity android:name="org.appcelerator.titanium.TiActivity" android:screenOrientation="portrait"/>
            </application>
        </manifest>
    </android>
When I load my app and the device is in landscape mode and I call:
Ti.Platform.displayCaps.getPlatformHeight();
Ti.Platform.displayCaps.getPlatformWidth()
they read what position the device is physically in and not what the UI is set to (Portrait). My understanding based on the docs was they'd read what the UI was set to and not the device. Is this not the case or am I just doing something wrong?

I'm using the 3.2.2.GA SDK with Alloy.

Thanks.


Viewing all articles
Browse latest Browse all 7655

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>