翻译动画是其他组件的背后

时间:2016-03-28 10:16:22

标签: android android-layout animation translate-animation

我的布局由下面显示的图像部分组成。我只想用从底部开始的翻译动画设置所有图像资源。当这样做时,动画开始于其他图像布局。我只是寻找解决方案,但没有找到解决方案。

android:clipChildren="false";   
yourLayout.bringToFront();   
setZAdjustment(Animation.ZORDER_TOP);

以上所有解决方案对我都没有用。有人可以帮助我吗?

我创建图片按钮的xml代码是

 <TableRow
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1">

    <LinearLayout
        android:layout_width="0dip"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:adjustViewBounds="true"
        android:background="@drawable/bck_game_image"
        android:layout_margin="1dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="4dp"
            android:background="@drawable/bos">

            <ImageButton
                android:id="@+id/buton0"
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:adjustViewBounds="true"></ImageButton>
        </LinearLayout>

    </LinearLayout>
.....
</TableRow>

enter image description here

1 个答案:

答案 0 :(得分:0)

使用以下代码行代替使用yourLayout.bringToFront(): -

linearLayout.bringChildToFront(imageView);
linearLayout.requestLayout();
linearLayout.invalidate();