我想爲我的程序創建一些簡單的動畫。 有4個不可見的按鈕,我想要的是程序啓動時,這些按鈕將延遲顯示。延遲顯示按鈕Android Java
顯示按鈕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) {
}
任何人都可以幫助我嗎?
它工作夥計!謝謝 – felangga