我想滑动一个整体的布局,从左到右,然后从右到左。
Utilities.vibrate(v.getContext()); Animation animation = AnimationUtils.loadAnimation(v.getContext(), R.anim.leave); mainView.startAnimation(animation);
这段代码将使它从左向右移动。
leave.xml 代码:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <translate android:fromXDelta="-90%" android:toXDelta="0%" android:fromYDelta="0%" android:toYDelta="0%" android:duration="700"/> </set>
运行挺好但是一旦转换就 done 掉了,回去最初的位置了。 如何让它保持滑动的位置呢?
白猪掌柜的
相关分类