首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在blackberry cascades QML中创建翻转动画

如何在blackberry cascades QML中创建翻转动画
EN

Stack Overflow用户
提问于 2014-12-08 02:39:41
回答 1查看 279关注 0票数 0

我刚接触blackberry cascades,我已经研究过github的blackberry cascades示例中的一些动画,但我不确定如何实现页面翻转动画而不是默认的推送和流行动画。下面是执行默认推送过渡到下一页的页面代码。我需要用flip替换这个转换。我该怎么做呢?

代码语言:javascript
复制
NavigationPane {
    id: nav
    peekEnabled: false
Page {
    id: mainPage

Button:
{
 onClicked:{

nav.push(homePageDefinition.createObject());
}
}

attachedObjects: [

    ComponentDefinition {
        id: homePageDefinition
        source: "homepage.qml"
    }
]
}
}
EN

回答 1

Stack Overflow用户

发布于 2014-12-09 07:13:53

尝试Flipable项目。例如:

代码语言:javascript
复制
Flipable {
    id: flipable
    anchors.fill: parent
    property bool flipped: false
    front: Rectangle {anchors.fill: parent; color: "green"}
    back: Rectangle {anchors.fill: parent; color: "yellow" }
    transform: Rotation {
        id: rotation
        origin.x: flipable.width/2
        origin.y: flipable.height/2
        axis.x: 0; axis.y: 1; axis.z: 0
        angle: 0
    }
    states: State {
        name: "back"
        PropertyChanges { target: rotation; angle: 180 }
        when: flipable.flipped
    }
    transitions: Transition {
        NumberAnimation { target: rotation; property: "angle"; duration: 500 }
    }
    MouseArea {
        anchors.fill: parent
        onClicked: flipable.flipped = !flipable.flipped
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27346334

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档