我刚接触blackberry cascades,我已经研究过github的blackberry cascades示例中的一些动画,但我不确定如何实现页面翻转动画而不是默认的推送和流行动画。下面是执行默认推送过渡到下一页的页面代码。我需要用flip替换这个转换。我该怎么做呢?
NavigationPane {
id: nav
peekEnabled: false
Page {
id: mainPage
Button:
{
onClicked:{
nav.push(homePageDefinition.createObject());
}
}
attachedObjects: [
ComponentDefinition {
id: homePageDefinition
source: "homepage.qml"
}
]
}
}发布于 2014-12-09 07:13:53
尝试Flipable项目。例如:
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
}
}https://stackoverflow.com/questions/27346334
复制相似问题