1 回答

TA貢獻(xiàn)1804條經(jīng)驗(yàn) 獲得超2個(gè)贊
嘗試這個(gè):
long start_time = System.currentTimeMillis();
long current_time = System.currentTimeMillis();
long time_limit = 2000; // In milliseconds: this is the time you want to show the
// object(2 sec)
while(current_time - start_time) != 2000) {
ShowObject(); //Here is where you show the object.
current_time = System.currentTimeMillis();
}
HideObject(); //Hide the object after the while loop
它應(yīng)該工作。當(dāng)然,你可以隨心所欲地實(shí)現(xiàn)它,因?yàn)檫@不是有史以來最干凈的代碼?;蛘撸绻胍咝У奶幚沓绦虻?,請(qǐng)參閱:
https://stackoverflow.com/questions/23838071/how-to-hide-a-imageview-and-show-it-after-5-second
添加回答
舉報(bào)