1

I have tried the code below:

final View v = txt; //txt is my textview
Animation anim = new Animation() {
  protected void applyTransformation(float interpolatedTime, Transformation animLinear) {
    super.applyTransformation(interpolatedTime, animLinear);
    // Do relevant calculations here using the interpolatedTime that
    // runs from 0 to 1
    v.setLayoutParams(new LinearLayout.LayoutParams(
    LayoutParams.MATCH_PARENT, (int) (500 * interpolatedTime)));
  }
};
anim.setDuration(1500);
v.startAnimation(anim);

It shows the layout line by line as you go down the view. I want a similar effect but in a reverse manner. In short, I want to show an animation wherein a TextView is hidden from bottom to top line by line. I do not want a sliding effect. I wanna hide a view line by line.

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
CoderDecoder
  • 445
  • 4
  • 18
  • Here is the ans : [solution according to my requirements][1] [1]: http://stackoverflow.com/questions/4946295/android-expand-collapse-animation – CoderDecoder May 06 '14 at 12:12

1 Answers1

1

Use This Code in Xml

 <scale
    android:duration="500"
    android:fromXScale="1.0"
    android:fromYScale="1.0"
    android:interpolator="@android:anim/linear_interpolator"
    android:toXScale="1.0"
    android:toYScale="0.0" />
Sem
  • 31
  • 3