2017-02-04 51 views
0

我與深化發展掛鉤火力地堡的帳戶系統的應用程序。動畫加載圖標在動作條

好了,簽了突未需要幾秒鐘,我想實現一個旋轉加載圖標像這樣的操作欄中:

enter image description here

唯一的問題是,我忽略瞭如何讓菜單項旋轉以及如何禁用onClick功能。

回答

0

使用RunnableThread.sleep(10);設置爲從可繪製圖像。

new Thread(new Runnable() { 
     @Override 
     public void run() { 
      stuff(); 
      finish(); 
     } 
    }).start(); 

而且

public void stuff(){ 
    for (int i=0;i<50;i+=5){ //put i< the number of images you have 
     try {    //for your animation. 
      Thread.sleep(10); 
      //set your image here. 
     } catch (InterruptedException e) { 
      e.printStackTrace(); 
     } 
    } 
} 
+0

你能更明確,好嗎? –

+0

我已經更新了我的答案。希望現在很清楚。 – Simo