我有这样的布局:
<?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秒之后,使用缩放过渡动画在最后一个图像视图上显示另一个图像。有可能吗? TNX !!!
答案 0 :(得分: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);