我在我的应用中应用了一个否定toXDelta
,TranslateAnimation
当我滚动到列表时这会导致一个错误,因为在这个移动中还有另一个列表。
你可以在这个屏幕截图中看到我的问题
这是我的橙色列表的 XML
<LinearLayout
android:id="@+id/ll_list_ghm"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/panel_ghm"
android:orientation="vertical"
android:paddingLeft="30dip"
android:paddingRight="20dip"
android:paddingTop="40dip" >
<ListView
android:id="@+id/lv_list_ghm"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</ListView>
</LinearLayout>
我将翻译应用于LinearLayout
ll_list_ghm.startAnimation(expend(500, true));
private Animation expend(int anim_ms, boolean is_ghm) {
Animation collapse = new TranslateAnimation(400, -20, 0, 0);
collapse.setDuration(anim_ms);
collapse.setFillAfter(true);
return collapse;
}
当toXDelta
等于 0 或正整数时没有问题。有人遇到过这个错误吗?
感谢您阅读和关注 ma 问题。