user687022
user687022

Reputation: 169

want a ImageView to come from upside down

i have a window and a imageview in it and i want the imageview to come from upside down animated effect how i do that

ImageView img_sliding=(ImageView)findViewById(R.id.img_sliding);

Upvotes: 0

Views: 582

Answers (2)

Kurru
Kurru

Reputation: 14331

Use a scale animation to scale from -1 to 1. This should have the effect of flipping the imageview

Upvotes: 0

Fabian
Fabian

Reputation: 2723

You have to write your own translate animation. a very good tutorial could be found here..

Here is a litte snipped that you can use and adapt it to your needs:

<translate
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromYDelta="100%"
    android:toYDelta="0%"
    android:duration="300"
    android:zAdjustment="top"
    android:fillAfter="true" />

create a new xml file in res/anim and then set the animation to your imageview like this:

Animation anim = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.YOURANIMATION)

and set it to the iamgeView

imageview.setAnimation(anim);

Upvotes: 1

Related Questions