【发布时间】:2017-08-05 17:38:21
【问题描述】:
我在 LinearLayout 中有 3 个元素,我需要为其中一个设置动画。
动画开始时,该元素不在其他元素之上,而是在下方。
我已经尝试使用bringToFront(),但它不起作用(像文档说的那样更改顺序)。
我需要为这个“垂直”布局的“@id/ton”设置动画的元素。
<LinearLayout
android:id="@+id/wrapInfo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:focusable="false"
android:layout_gravity="center_horizontal"
android:orientonion="vertical"
android:clipChildren="false" >
<ImageButton
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="5dp"
android:background="@null"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_gravity="center_horizontal"
android:src="@drawable/yourlogohere" />
<TextView
android:id="@+id/ton"
android:layout_height="0dp"
android:layout_weight="2"/>
<WebView
android:id="@+id/web"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight = "1"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/>
</LinearLayout>
在这种情况下,TextView 位于 WebView 的下方。
我使用 LinearLayout 因为我需要这些元素是设备高度的 25/50/25%(我使用 weight xml 属性)。
【问题讨论】:
标签: android android-animation android-linearlayout