2010-12-14 51 views
3

Je suis débutant au développement android et actuellement j'étudie l'animation 3D en passant par le fichier Rotate3dAnimation dans le projet ApiDemos. Cette classe montre l'image dans l'ordre inverse, j'essaie d'afficher ce contrôle pour afficher l'image dans l'ordre réel, mais ma malchance continue. Pourriez-vous s'il vous plaît me conseiller quelle ligne qui montre l'image dans l'ordre inverse?Android ApiDemos - Rotate3dAnimation

Merci, Shan

Répondre

3

La réponse est simple, vous changer les rotations applyed à:

applyRotation (-1, 0, 90); et applyRotation (1, 0, 90);

c'est lorsque vous l'appelez et quand vous l'appelez pour la deuxième moitié vous utilisez ce qui suit:

 if (mPosition > -1) { 
      mStartView.setVisibility(View.GONE); 
      mEndView.setVisibility(View.VISIBLE); 
      mEndView.requestFocus(); 

      //rotation = new Rotate3dAnimation(90, 180, centerX, centerY, 310.0f, false); 
      rotation = new Rotate3dAnimation(-90, 0, centerX, centerY, 310.0f, false); 
     } else { 
      mEndView.setVisibility(View.GONE); 
      mStartView.setVisibility(View.VISIBLE); 
      mStartView.requestFocus(); 

      rotation = new Rotate3dAnimation(-90, 0, centerX, centerY, 310.0f, false); 
      //rotation = new Rotate3dAnimation(90, 0, centerX, centerY, 310.0f, false); 
     } 

Je l'ai fait remarquer à l'ancienne mise en œuvre.