Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5614] Ti.Gesture has 3 orientation

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2018-02-23T18:35:29.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterGuile
AssigneeShak Hossain
Created2018-02-22T17:30:29.000+0000
Updated2018-02-23T18:35:29.000+0000

Description

IOS SDK 7.0.2GA It is possible to have Gesture.portrait == false and Gesture.landscape == false Ti.Gesture.addEventListener('orientationchange', function (e) { Ti.API.info('source.portrait:' + e.source.portrait + ' source.landscape:' + e.source.landscape); }); You only have to put your tablet on a table (horizontaly) This is inconsistent.

Comments

  1. Joshua Quick 2018-02-23

    This is not a bug. This is the correct behavior. Ti.Gesture provides the device's orientation, not the app window's orientation. So, when you lay the tablet flat on a table, the Ti.Gesture.orientation property will return FACE_UP if the screen is facing up towards the sky or FACE_DOWN if the screen is facing down towards the Earth. The device will only return true for portrait or landscape when the device is held upright, but note that this does not represent the orientation of the app window. If you want to know the orientation of your app window, then you should read the Ti.UI.Window.orientation property instead. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Window-property-orientation
  2. Guile 2018-02-23

    You are right ! Sorry for the wrong issue. I misused these informations since the beginning
  3. Joshua Quick 2018-02-23

    No worries. Happy to help!

JSON Source