将动画图像视图浮动在LinearLayout-android中其他元素的顶部

将动画图像视图浮动在LinearLayout-android中其他元素的顶部,android,animation,layout,z-index,android-linearlayout,Android,Animation,Layout,Z Index,Android Linearlayout,我有一个扩展的ImageView,我在屏幕上水平(在线性布局内)重复使用了7次。此ImageView的正上方和正下方是其自身线性布局内的其他扩展ImageView。我使用LinearLayout中的“权重”(weight)属性将这些元素均匀地隔开,以便它们在屏幕上均匀地隔开。我需要做的是让这个中间的ImageView能够浮动在它与动画对齐的顶部或底部ImageView的顶部。是否有某种z-指数可以放在元素上,这样我就可以将中间的IV浮在其他IV之上 我的xml代码片段: <LinearLa

我有一个扩展的ImageView,我在屏幕上水平(在线性布局内)重复使用了7次。此ImageView的正上方和正下方是其自身线性布局内的其他扩展ImageView。我使用LinearLayout中的“权重”(weight)属性将这些元素均匀地隔开,以便它们在屏幕上均匀地隔开。我需要做的是让这个中间的ImageView能够浮动在它与动画对齐的顶部或底部ImageView的顶部。是否有某种z-指数可以放在元素上,这样我就可以将中间的IV浮在其他IV之上

我的xml代码片段:

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/opponentrow">
    <ImageView
        android:id="@+id/your1"
        android:layout_width="45px"
        android:layout_height="60px"
        android:src="@drawable/topimage"
        android:layout_weight="1" />
        ...
</LinearLayout>
<LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/tokenrow">
    <ImageView
        android:id="@+id/your1"
        android:layout_width="20px"
        android:layout_height="20px"
        android:src="@drawable/centerimage"
        android:layout_weight="1" />
        ...             
</LinearLayout>
<LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <ImageView
        android:id="@+id/your1"
        android:layout_width="45px"
        android:layout_height="60px"
        android:src="@drawable/bottomimage"
        android:layout_weight="1" />
        ...
</LinearLayout>
一些重要的注意事项:我需要为7个元素(全部3行)保留均匀的水平间距。如果线性布局不能满足我的目标,我愿意使用不同的布局类型


感谢您抽出时间

我最终编写了一个自定义视图并调用了一个堆叠的xml文件,其中包含:

View view=layoutInflater.inflate(R.layout.handlayout, this);
它似乎很有效,实际上我更喜欢这个解决方案,因为我将所有三个元素(在“列”中)都包含在一个视图中

View view=layoutInflater.inflate(R.layout.handlayout, this);