大家好,我想用图像的动画做启动画面,从屏幕上的顶部到中间一个接一个,然后做一个小动画,例如图像img1从屏幕的顶部到中间,然后img2从高到屏幕的中间是图像img1右侧的这个地方,依此类推......最后,图像形成一个词这是我使用的代码
final int TIME_OUT = 400;
final ImageView imageView1 = (ImageView) findViewById(R.id.img1);
final ImageView imageView2 = (ImageView) findViewById(R.id.img2);
final ImageView imageView3 = (ImageView) findViewById(R.id.img3);
final ImageView imageView4 = (ImageView) findViewById(R.id.img4);
final ImageView imageView5 =(ImageView)findViewById(R.id.img5);
final ImageView imageView6 =(ImageView)findViewById(R.id.img6);
final ImageView imageView7 =(ImageView)findViewById(R.id.img7);
final ImageView imageView8 =(ImageView)findViewById(R.id.img8);
final ImageView imageView9 =(ImageView)findViewById(R.id.img9);
final ImageView imageView10 =(ImageView)findViewById(R.id.img10);
final ImageView imageView11 =(ImageView)findViewById(R.id.img11);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView1.setVisibility(View.VISIBLE);
}
}, TIME_OUT);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView2.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 2);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView3.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 3);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView4.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 4);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView5.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 5);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView6.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 6);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView7.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 7);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView8.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 8);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView9.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 9);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView10.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 10);
new Handler().postDelayed(new Runnable() {
// This method will be executed once the timer is over
@Override
public void run() {
imageView11.setVisibility(View.VISIBLE);
}
}, TIME_OUT * 11);
splashTread=new Thread(){
@Override
public void run(){
try {
int waited = 0;
// Splash screen pause time
while (waited < 3000) {
sleep(180);
waited += 90;
}
Intent intent = new Intent(splash.this,MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
finish();
splash.this.finish();
}catch (InterruptedException e) {
// do nothing
} finally {
splash.this.finish();
}
}
};
splashTread.start();
}
}
尝试使用这个很棒的第三方库。洛蒂
根据您的要求创建一个 After Effects Adobe 动画文件,然后使用此库在您的应用程序中解析和使用它。