【发布时间】:2015-07-05 13:39:59
【问题描述】:
我想在 2 秒后增加线性布局的高度。 加载活动后,应用程序应等待 2 秒,然后线性布局的高度应从 200dp 增加到 300dp。 xml代码如下所示。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fffafaf9"
android:clipChildren="false"
tools:context=".MainActivity">
<TextView android:text="@string/hello_world"
android:id="@+id/top"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:paddingTop="30dp"
android:paddingLeft="20dp"
/>
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_below="@id/top"
android:background="#ffd3d3d2" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<View
android:id="@+id/temp_view"
android:layout_width="100dp"
android:layout_height="100dp"
android:visibility="visible"
android:translationZ="20dp"
android:layout_gravity="center_horizontal"
android:background="@drawable/circle_shape"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_marginTop="-80px"
android:background="#ffe4e4e3"
android:elevation="-10dp"
android:alpha="0.5"
android:layout_below="@id/temp_view"
>
</LinearLayout>
【问题讨论】:
标签: android animation android-linearlayout