为什么我 ImageView imageView = (ImageView)findViewById(R.id.anim);
final AnimationDrawable anim = (AnimationDrawable)imageView
.getBackground();
anim.start();
这样不动,但是 ImageView imageView = (ImageView)findViewById(R.id.anim);
//获取AnimationDrawable动画对象
final AnimationDrawable anim = (AnimationDrawable)imageView
.getBackground();
play.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
//开始播放动画
anim.start();
}
});
这样却动了呢,应用程序启动动画到底如何实现比较好呢
final AnimationDrawable anim = (AnimationDrawable)imageView
.getBackground();
anim.start();
这样不动,但是 ImageView imageView = (ImageView)findViewById(R.id.anim);
//获取AnimationDrawable动画对象
final AnimationDrawable anim = (AnimationDrawable)imageView
.getBackground();
play.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
//开始播放动画
anim.start();
}
});
这样却动了呢,应用程序启动动画到底如何实现比较好呢
解决方案 »
- 爱可视9 G2(ARNOVA9 G2)平板坏了
- android 手机流量监控求代码
- Android 4.0 for x86 发布
- (结贴率100%)xml解析。。。。根据下面要求把下面的xml文件解析了。。。
- android 环境搭建出问题
- android 选项卡跳转问题
- post传递数组 求帮助
- 关于N5截图 通过 fb0问题
- android的gps应用里,卫星是怎么编号的?
- CTS测试 com.android.cts.appsecurity.AppSecurityTests -- testPermissionDiffCert
- Activity之间跳转的问题
- android JNI生成头文件出现问题,求高手帮忙解答一下
http://www.eoeandroid.com/thread-31658-1-1.html
import android.content.Intent;
import android.os.Bundle;
import android.view.animation.AlphaAnimation;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;public class LogoActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//去掉标题栏
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.setContentView(R.layout.logo);
//透明度动画
AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f,1.0f);
alphaAnimation.setDuration(3000);
alphaAnimation.setAnimationListener(new AnimationListener(){ @Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
Intent intent = new Intent(LogoActivity.this,LoginActivity.class);
startActivity(intent);
finish();
} @Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
});
this.findViewById(R.id.logoback).startAnimation(alphaAnimation);
}
}这是一个简单的三秒透明度动画,透明度动画过后可根据你的需要跳转到其他Activity