how to rotate a view along x axis
android-animation
Solution
Use an ObjectAnimator like this:
ObjectAnimator animation = ObjectAnimator.ofFloat(view, "rotationX", 0.0f, 360f);
animation.setDuration(5000);
animation.setRepeatCount(ObjectAnimator.INFINITE);
animation.setInterpolator(new AccelerateDecelerateInterpolator());
animation.start();
Problem
I want to rotate a view along its x axis.I tried to do the following: ``` AnimationSet anim=new AnimationSet(true); RotateAnimation rotate=new RotateAnimation(0.0f,-10.0f,RotateAnimation.ABSOLUTE,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f); rotate.setFillAfter(true); rotate.setDuration(5000); rotate.setRepeatCount(0); anim.addAnimation(rotate); View relatv1=(View)findViewById(R.id.relativeLayout1); relatv1.setAnimation(anim); ``` but i instead the view rotates along its y axis.How can i accomplish x axis rotation?