QML类型说明-AnchorAnimation
来源:互联网 发布:鄂州软件开发公司 编辑:程序博客网 时间:2024/04/29 22:41
AnchorAnimation
ImportStatement:
Inherits:
Properties
duration : int
easing
easing.type : enumeration
easing.amplitude : real
easing.overshoot : real
easing.period : real
targets : list
DetailedDescription
AnchorAnimation用于描述动画的锚的变化。
下面的代码片断,我们右锚接一个矩形到动画。
import QtQuick 2.0
Item {
id: container
width: 200; height: 200
Rectangle {
id: myRect
width: 100; height: 100
color: "red"
}
states: State {
name: "reanchored"
AnchorChanges { target: myRect; anchors.right:container.right }
}
transitions: Transition {
// smoothly reanchor myRect and move into newposition
AnchorAnimation { duration: 1000 }
}
Component.onCompleted: container.state ="reanchored"
}
当AnchorAnimation被用在过渡中,它将在状态变化时发生锚改变动画。它用AnchorChanges.target属性重置指定的目标。
注意AnchorAnimation仅仅只能用于Transition并和一个AnchorChange结合。它不能用于behaviors和其他类型的动画。同时参阅Animation、Transitions以及AnchorChanges。
PropertyDocumentation
duration : int
动画持续的时间,以毫秒为单位。默认值是250。
easing group
easing.type : enumeration
easing.amplitude : real
easing.overshoot : real
easing.period : real
指定动画曲线。至少需要指定类型。对一些曲线,我们还可以指定振幅、时间和过冲。默认的动画曲线是线性的。
示例代码:
AnchorAnimation { easing.type: Easing.InOutQuad}
同时参阅PropertyAnimation::easing.type文档了解动画曲线的不同类型。
targets : list
重新锚定的目标。如果没有指定,那所有的AnchorChanges将被AnchorAnimation动画化。- QML类型说明-AnchorAnimation
- QML类型说明-Accessible
- QML类型说明-Action
- QML类型说明-Address
- QML类型说明-Affector
- QML类型说明-Age
- QML类型说明-Altimeter
- QML类型说明-AltimeterReading
- QML类型说明-AmbientLightReading
- QML类型说明-AmbientLightSensor
- QML类型说明-AnchorChanges
- QML类型说明-AngleDirection
- QML类型说明-ParallelAnimation
- QML类型说明-Animator
- QML类型说明-AnimatedImage
- QML类型说明-AnimatedSprite
- QML类型说明-ApplicationWindow
- QML类型说明-SequentialAnimation
- 诺贝尔物理学奖揭晓! 4问题搞懂「上帝粒子」
- QML类型说明-AmbientLightReading
- QML类型说明-AmbientLightSensor
- QML类型说明-AmbientTemperatureRe…
- QML类型说明-AmbientTemperatureSe…
- QML类型说明-AnchorAnimation
- QML类型说明-AnchorChanges
- QML类型说明-AngleDirection
- QML类型说明-ParallelAnimation
- QML类型说明-Animator
- QML类型说明-AnimatedImage
- QML类型说明-AnimatedSprite
- QML类型说明-AttenuationModelInve…
- 使用Pspice进行电路仿真