Home > Software design >  Android animation to show a view from bottom to top via animation
Android animation to show a view from bottom to top via animation

Time:09-22

I want to have an effect where a view appears from bottom of the view to top. For example, I want to effect to be opposite to what is happening in the slide_down in animation link below.

But the slide up animation in this page is actually causing the view to disappear, I'd rather want it to appear in a bottom up manner in its place.

How could I do this?

One way I think I can do is via translating the view from 0 to -100% YDelta, but that doesnt seem the same as what the slide down effect is on that page.

Animation

CodePudding user response:

Answering for others, in case they need this. we can use pivotY = 100% and it will start from the bottom of view.

CodePudding user response:

Show Animation using

view.startAnimation(AnimationUtils.loadAnimation(this, R.anim.view_anim))

Add view_anim.xml to your res/anim folder

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
    <translate
        android:duration="500"
        android:fromYDelta="100%p"
        android:toYDelta="0" />
</set>
  • Related