1

我有这样的布局:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@android:color/white"
    android:gravity="center"
    android:orientation="vertical" >

    <LinearLayout android:id="@+id/linearLayout1"
        android:layout_width="fill_parent" android:orientation="vertical"
        android:layout_height="fill_parent" android:weightSum="1">

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/who" 
            android:layout_gravity="center"
            android:layout_weight="0.3"/>



    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Presents"
        android:textColor="@color/color1"
        android:textAppearance="?android:attr/textAppearanceLarge" 
        android:layout_gravity="center"
        android:layout_marginTop="20dp"
        android:layout_weight="0.1"
        />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/logo"
        android:layout_gravity="center"
        android:layout_weight="0.6" 
        />
</LinearLayout>
</LinearLayout>

和活动:

package com.n;

import android.app.Activity;
import android.os.Bundle;

public class MyMainActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
    }
}

我想要的是,在 X 秒后,在最后一个图像视图上显示另一个图像,并带有缩放过渡动画。有可能吗?天呐!!!

4

1 回答 1

0

是的,你可以用缩放动画做到这一点

它应该是这样的(我不是 100% 确定比例动画的值,但你可以玩它)

private static final int DURATION = "put here duration...";
private static final int OFFSET = "put here offset...";


ScaleAnimation zoomAnimation = new ScaleAnimation(0.1f, 1.0f, 0.1f, 1.0f, 0.5f,0.5f);
zoomAnimation.setDuration(DURATION);
zoomAnimation.setStartOffset(OFFSET); 
newImageView.startAnimation(zoomAnimation);
于 2012-10-03T16:27:57.850 回答