我想为我的程序创建一些简单的动画。有 4 个不可见的按钮,我想要的是当程序启动时,这些按钮会延迟可见。
显示按钮 1 -> 按钮 2 -> 等等。
我试过这个,但是当程序运行时,所有按钮都会同时出现。
try {
((Button) findViewById(R.id.f1)).setVisibility(View.VISIBLE);
Thread.sleep(1200);
((Button) findViewById(R.id.f2)).setVisibility(View.VISIBLE);
Thread.sleep(1200);
((Button) findViewById(R.id.f3)).setVisibility(View.VISIBLE);
Thread.sleep(1200);
((Button) findViewById(R.id.f4)).setVisibility(View.VISIBLE);
Thread.sleep(1200);
} catch (Exception e) {
}
任何人都可以帮助我吗?