Ich habe das Problem, dass meine Animation nicht zum zweiten Mal auf Knopfdruck anwenden wird. Ich habe this library.Ich möchte die Rotation des Bildes mit Animation. aber Problem ist, dass es nur einmal funktioniert.Animation nicht zum zweiten Mal auf Knopfdruck anwenden
hier ist mein Code auf die Schaltfläche klicken
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewAnimator.animate(imageView)
.rotation(rotationAngle).duration(1000)
.repeatMode(ValueAnimator.RESTART)
.start();
if(rotationAngle==360)
{
rotationAngle=180;
}
else
{
rotationAngle += 180;
}
}
});
der Link nicht bieten hilft mehr arbeiten –
was ist der Anfangswert für Sie Rotation Variable setzen? –
180 @AbdulWaheed –