PDA

View Full Version : PropertyAnimation : change property in each object individually



laslo
3rd October 2016, 13:02
Hi,

I'm trying to increase the y property in each object from the "targets" list:




ParallelAnimation{

PropertyAnimation
{
target: 0.children[0];
properties: "height";
to:0.children[0].implicitHeight ;
duration: 300
}
PropertyAnimation
{
targets: [1,2];
properties: "y";
to: y + 0.children[0].implicitHeight; //here I want to add the height of the gray square to 1.y and 2.y individually but it returns 0, button 1 and 2 overlap.
duration: 300;
}




This image shows what I want to achieve.

12137

When I click on the button 0 the gray square shows up and in the same time button 1 and 2 go down.
What is the best way to achieve this without adding new PropertyAnimation for each target button?

Thanks

anda_skoa
6th October 2016, 15:45
You can simply animate a property that you add to some object and bind both targets' "y" to that property.