Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.8.0
-
None
-
iOS 9.3.5 and iOS 10.3.1, various Android Versions.
Description
The following piece of code lands incoherent results between Android and iOS when rotating a phone, with iOS likely being wrong:
import QtQuick.Window 2.2 Rectangle { id: sceneRect anchors.fill: parent Flickable { id: mainFlickable anchors.fill: parent ListView: { id: // something width: parent.width height: // something x: // something y: // something onWidthChanged: { if (Screen.desktopAvailableHeight > Screen.desktopAvailableWidth) { console.log("a"); } else { console.log("b"); } } } } }
Additional Information:
The QML file with this code is loaded via a Loader element into a Window Element that has width: Screen.desktopAvailableWidth and height: Screen.desktopAvailableHeight.
Expected outcome:
"a" to be logged when the phone or tablet is switched to portrait mode, "b" to be logged when the phone or tablet is switched to landscape mode.
Outcome result:
Portrait mode: "a" on Android, "b" on iOS.
Landscape mode: "b" on Android, "a" on iOS.
Temporal workaround:
Interestingly enough, changing the set width of the ListView to Screen.desktopAvailableWidth (from parent.width), which should be identical in this case, solves the problem on iOS. No change on Android (as it was working anyways).