2011-09-30 72 views
0

假設我有三個文本爲heading.Any如何取textview或任何東西。一個文本在左邊,一個在中心,一個在右邊。所以我想要一個動畫,當我滑動左邊的屏幕左邊的文字將會消失,中間文字會左右兩邊文字將會出現在中心位置。爲正確的幻燈片而準備。可以給任何人提出如何實現這種類型的動畫。Plz的幫助。如何在android中執行webview動畫

+0

http://stackoverflow.com/questions/7592957/moving-image - 用於功能的Android/7593041#7593041 –

回答

0

你可以嘗試創建一個動畫變量:

private Animation leftAnimation() { 

     Animation outtoLeft = new TranslateAnimation(
       Animation.RELATIVE_TO_SELF, 0.0f, 
       Animation.RELATIVE_TO_SELF, 0.0f, 
       Animation.RELATIVE_TO_SELF, 1.0f, 
       Animation.RELATIVE_TO_SELF, 0.0f); 
     outtoLeft.setDuration(500); 
     outtoLeft.setInterpolator(new AccelerateInterpolator()); 
     return outtoLeft; 
    } 

然後 集這個動作你的框架:

public void onLeftArrowClick(View v) { 
     frame.setAnimation(moveComingSoonToBottomAnim); // your Frame variable 
     animVariable.startNow();// your anime variable 
     frame.setVisibility(View.VISIBLE); 
     rightFrame.setVisibility(View.GONE); // hide your right text view 
    }