2

I want to set rotation to the view through Layout Parameter by calling setLayoutParams Here I can set margins

 RelativeLayout.LayoutParams paramsForSpinnerTextView=(RelativeLayout.LayoutParams)spinnerTextView.getLayoutParams();
    paramsForSpinnerTextView.setMargins(30,30,30,30);
    spinnerTextView.setLayoutParams(paramsForSpinnerTextView);

Same way, Is there any way to set rotation to the layout parameter.

EDIT:

Yes, I can simply rotate the view using spinnerTextView.setRotation(-90) but this is instantaneous and does not show any animation. My parent layout is Relativelayout with a attribute android:animateLayoutChanges="true" until unless I change the child views attribute using setlayoutParams animation attribute of parent will not do anything.

And I also know that I can use rotate animation but that will not move the touch area of the view.

1 Answers1

0

As per I know there is no way to set rotation to the layout parameter. There are other ways to achieve what you want.

  1. Apply rotation animation
  2. Listen to the animation end event
  3. There, just call setRotation(required_angle) on your view
Praveena
  • 6,340
  • 2
  • 40
  • 53