我有一个包含多个项目的ListView。
当用户点击一个项目时,该项目的高度应缩小为零,下面所有项目应向上滚动。
我的代码无法实现这个效果。
使用我的代码,被点击的项目会正确缩放,但是下面的项目没有滚动,它们保持在原来的位置。
我也尝试了使用LinearLayout,但是问题依然存在。
有一个可以正常实现这个功能的应用程序,它叫做Tasks。
有一个可以正常实现这个功能的应用程序,它叫做Tasks。
我的当前实现看起来像这样:
@Override
public void onItemClick(AdapterView<?> arg0, View v, final int index,
long id) {
Animation anim = AnimationUtils.loadAnimation(getActivity(),
R.anim.scaleup);
v.startAnimation(anim);
}
<set android:shareInterpolator="false" >
<scale
android:duration="700"
android:fillAfter="false"
android:fillBefore="false"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotY="0%"
android:toXScale="1.0"
android:toYScale="0.0" />
</set>