1

Define a TextView element like this:

<TextView
    android:id="@+id/rotate_text"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentBottom="true"
    android:text="This text string will behave strangely" 
    android:textSize="14sp"/>

Then give it the following rotation and observe what happens:

RotateAnimation rot90 = new RotateAnimation(0.0f, -90.0f);
rot90.setDuration(10000);
rot90.setFillAfter(true);
findViewById(R.id.rotate_text).setAnimation(rot90);

As the text rotates, it expands, contracts and sometimes loses one or two characters at the end. For a given angle, except 0 or 90 degrees, you won't know how long the text will end up, or even if all of it will be displayed.

Is it supposed to be this way? And is there a workaround?

CharlesB
  • 86,532
  • 28
  • 194
  • 218
Karl H.
  • 11
  • 2

0 Answers0