1

次のように TextView 要素を定義します。

<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"/>

次に、次の回転を与えて、何が起こるかを観察します。

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

テキストが回転すると、テキストが拡大、縮小し、最後に 1 ~ 2 文字失われることがあります。0 度または 90 度を除く特定の角度では、テキストが最後にどれくらいの長さになるか、またはすべてが表示されるかどうかさえわかりません。

このままでいいのでしょうか?回避策はありますか?

4

0 に答える 0