2011-09-30 2 views
0

Supposons que j'ai trois textes en tant que rubrique.Tout comment vous pouvez prendre textview ou quoi que ce soit.un texte sur la gauche, un au centre et un à droite.J'ai envie d'une animation quand je vais glisser l'écran à gauche, puis le texte à gauche sera parti, le texte du centre viendra à gauche et le texte à droite viendra au centre.Même chose pour la diapositive droite.Peut-on suggérer comment puis-je réaliser ce type d'animation.Plz aide.Comment faire une animation webview en android

+0

http://stackoverflow.com/questions/7592957/moving-image -pour-android/7593041 # 7593041 –

Répondre

0

Vous pouvez essayer de créer une variable d'animation:

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; 
    } 

puis ensemble cette action à votre image:

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 
    } 
Questions connexes