0

ネガを適用するtoXDeltaTranslateAnimation、リストにスクロールするとバグが発生します。これは、このリストに別のリストがあるためです。

このスクリーンキャプチャで私の問題を見ることができますここに画像の説明を入力

オレンジ リストの 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の問題について読んでくれてありがとう。

4

1 に答える 1

0

コードに負のマージンを設定するという別の解決策を見つけました。

RelativeLayout.LayoutParams lp_list_ghm = new RelativeLayout.LayoutParams(metrics.widthPixels / 4, LayoutParams.FILL_PARENT);
lp_list_ghm.addRule(RelativeLayout.RIGHT_OF, R.id.ll_list_cmd);
lp_list_ghm.setMargins(-20, 0, 0, 0);
ll_list_ghm.setLayoutParams(lp_list_ghm);

しかし、他の解決策があれば、私は興味があります:)

于 2012-03-15T08:06:09.387 に答える