advise in setting the size (width and height) of the item container



  • Hi experts,

    I would like to know the better way in setting the size of the container or pages so that it would be smooth when changing orientation.

    In my main file, i have a StackView where new pages will be push, when needed and pop to hide from the screen. My problem is, when changing orientation, the width and height of the SatckViewdelegate were not smoothly filling up the entire page. For example when changing from Portrait to Landscape, at some point the page width will remain for millisecond before adjusting to the new width of the screen. This is visible because I have a white background color and you can see the black screen prior adjusting the width to fill the screen. This same goes when changing orientation from Landscape to Portrait.

    I have tried adding properties when pushing new item on the Stack.

    push({item: Qt.resolveUrl("NewPage.qml"), properties: {width: stackView.width, height: stackview.height}});
    

    Without adding such properties when pushing new item on Stack, it works perfectly for iOS, it is smoothly adjusting it's width and height when changing orientation.

    This issue is only visible in Android.

    When i tried displaying a Rectangle only as a test, it works perfectly when changing orientation. The width and height smoothly adjusting or filling the entire screen when rotating the screen.

    Please advise. Thanks.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.