2012-01-30 146 views
0

我使用動畫從右向左移動佈局。Android動畫從右向左移動佈局

動畫無法正常工作。當視圖正在移動時,移動視圖的底部和右側邊緣會在屏幕上繪製,如下圖所示。 有誰知道原因和如何解決這個問題?謝謝!

+3

分享您的代碼,否則其很難說一些關於烏爾問題,而無需通過代碼去。 – himanshu 2012-01-30 10:22:47

+1

你說的照片在哪裏?顯示你的代碼。 – Debarati 2012-01-30 11:55:46

回答

0

請參閱鏈接here。該動畫適用於列表視圖適配器和活動。你只是嘗試一下。

民營動畫inFromRightAnimation(){

Animation inFromRight = new TranslateAnimation(
      Animation.RELATIVE_TO_PARENT, +1.0f, 
      Animation.RELATIVE_TO_PARENT, 0.0f, 
      Animation.RELATIVE_TO_PARENT, 0.0f, 
      Animation.RELATIVE_TO_PARENT, 0.0f); 
    inFromRight.setDuration(500); 
    inFromRight.setInterpolator(new AccelerateInterpolator()); 
    return inFromRight; 
    }