使用QtQuick,我在中繼器中有一行5個圖像。我想在懸停上實現一個類似於MacOS Dock動畫的動畫。下面是引用圖片:QML中的MacOS dock類組件
爲了進一步打破它,這裏就是我試圖完成。這些圖片,懸停時,應採取行動如下:
- 徘徊圖像擴大
- 相鄰圖像擴大,但稍微少
- 鏡像不能在擴展
這裏重疊是代碼我至今
Row {
spacing: 2
anchors.bottom: parent.bottom
anchors.bottomMargin: 30
anchors.horizontalCenter: parent.horizontalCenter
Repeater {
id: iconRepeater
model: iconColors()
Image {
source: "icons/" + modelData + ".png"
scale: mouseArea.containsMouse ? 1.5 : 1.0
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onClicked: endTimer()
}
Behavior on scale {
PropertyAnimation {
duration: 75
}
}
}
}
}
這擴大你將鼠標懸停在圖片,但我似乎不能也影響了巾幗不讓鬚眉ghbors。任何建議表示讚賞!
呀,這不是因爲行會工作使用間距的寬度,改變比例不會改變寬度。 – dtech