答案 0 :(得分:0)
在视图背景中使用以下可绘制文件。
`public class splash extends AppCompatActivity{
private TextView tv;
private ImageView iv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
tv = (TextView) findViewById(R.id.tv);
iv = (ImageView) findViewById(R.id.iv);
Animation myan = AnimationUtils.loadAnimation(this,
R.anim.mytransition);
tv.startAnimation(myan);
iv.startAnimation(myan);
Thread time = new Thread(){
public void r () {
try {
sleep(5000);
}catch (InterruptedException e) {
e.printStackTrace();
}
finally {
startActivity(new Intent(splash.this, MainActivity.class));
finish();
}
}
};
time.start();
}
}`