Disable rotating animation when orientation change



  • Hi,

    May I ask if there is anyway disable rotating animation when screen orientation changed? In my application, I'm using PageStack to push a landscape page from a current portrait page. The animation make it look not really nice.

    Regards,

    Hoang HUA


  • Moderators

    In a slot that handles the orientation change, use animation.stop() or animation.complete().



  • on PageStackWindow, i tried to use

    @
    onOrientationChangeAboutToStart: {
    animation.complete();
    }
    @

    however, it says "ReferenceError: Can't find variable: animation". should I need to change something to make it works. Thanks


  • Moderators

    I used "animation" as the id of QML Animation object. You should use the id from your app. So, if you are using "myAnimation" as id, you should write:
    @
    onOrientationChangeAboutToStart: {
    myAnimation.complete();
    }
    @



  • Hi,

    Maybe I'm wrong, but when you change the orientation with
    @orientationLock = PageOrientation.LockLandscape;@

    the screen will be automatically rotated, so this animation is not created or handled by us; so is it possible for us to get this animation object so that we can stop it?

    Thanks


  • Moderators

    Oh, sorry. I thought you are talking about an animation you have created yourself.

    In this case, I don't know what the solution is, probably, something OS-dependent has to be tweaked. I'm creating an app, it supports orientation changes, but no animation is played by default (that's on Android. And to be honest, I've just realised I've turned animations off in OS settings... ;) ).



  • [quote author="sierdzio" date="1328776250"]Oh, sorry. I thought you are talking about an animation you have created yourself.

    In this case, I don't know what the solution is, probably, something OS-dependent has to be tweaked. I'm creating an app, it supports orientation changes, but no animation is played by default (that's on Android. And to be honest, I've just realised I've turned animations off in OS settings... ;) ).[/quote]

    @sierdzio: LOL

    I've also not yet able to do this; however, a workaround can be done here which is to hide (visible) the PageStackWindow when orientation's animation take place. Not a perfect way but it works :-)


Log in to reply
 

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