在我的Android应用中,我使用动画将视图向上滑动。我的资源文件如下所示:
<?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="1300"
android:duration="700"/>
</set>
在代码中,我像这样执行动画:
RelativeLayout rlMapContainer = (RelativeLayout) getActivity().findViewById(R.id.rlMapContainer);
Animation animation = AnimationUtils.loadAnimation(context, R.anim.map_anim_up);
rlMapContainer.startAnimation(animation);
我希望能在运行时更改fromYDelta的值,你能告诉我如何实现吗?
} }); - Pablo Alfonso