<ImageView
android:id="@+id/imageView1"
android:layout_width="300dp"
android:layout_height="300dp"
android:src="@drawable/zaid1"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
I have an imageview in the middle of an activity, how would I make it so it rotates 360 degrees endlessly?
Try to use RotateAnimation
:
RotateAnimation rotateAnimation = new RotateAnimation(0, 360f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setDuration(500);
rotateAnimation.setRepeatCount(Animation.INFINITE);
findViewById(R.id.imageView1).startAnimation(rotateAnimation);