开发者

Bug in Android rotated TextView?

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开发者_如何学JAVA.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜