animation - Android animate TextView from middle of page to the top -
i have textview in middle of page in xml file. i'd move in animate way top of it's container when click on it.
what's best way this?
thanks.
define translate animation , set in res/anim folder.
this 1 moves view 175 dp, adjust android:toydelta accordingly purposes.
my_anim.xml:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator"> <translate android:fromydelta="0" android:toydelta="-175" android:duration="700"/> </set>
load code:
animation myanim = animationutils.loadanimation(getactivity(), r.anim.my_anim);
then set on textview when want animate:
mytextview.startanimation(myanim);
android animation android-animation android-textview
No comments:
Post a Comment