QtQuick/Qml系列教程

Qml弹出右侧信息弹窗

2018-11-29  本文已影响0人  zhengtianzuo

右侧信息弹窗使用PropertyAnimation来控制窗体的opacity透明度和Y坐标 就可以实现弹窗效果了

PropertyAnimation{
        id: hideAnimation
        target: subWindow
        properties:"opacity"
        from: 1.0
        to: 0.0
        duration: 300
        onStopped: {
            subWindow.visible = false;
        }
    }

    PropertyAnimation{
        id: downAnimation
        target: subWindow
        properties:"y"
        from: root.y
        to: root.y + 24
        duration: 300
    }

show.gif

需要完整代码请访问QtQuickExamples

上一篇 下一篇

猜你喜欢

热点阅读