Milos Cuculovic
Milos Cuculovic

Reputation: 20223

Android ScaleAnimation, how to use it to make items smaller, not bigger

I am using ScaleAnimation. I I would like to double the sizeof my item, it's easy:

ScaleAnimation  setSizeForTop = new ScaleAnimation(1, 2, 1, 2);

and then:

top.startAnimation(setSizeForTop);

but once i have a big item (hiz size x2), how to make it smaller, not to doble as before but to divide the animation size by 2.

Thank you.

Upvotes: 1

Views: 935

Answers (2)

Ossama
Ossama

Reputation: 2433

this will stop it moving

ScaleAnimation(1, 1.5f, 1, 1.5f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f)

Upvotes: 0

Blackbelt
Blackbelt

Reputation: 157437

did you try setSizeForTop = new ScaleAnimation(1, .5f, 1, .5f); ?

Upvotes: 1

Related Questions