1

谁能告诉我如何在android中创建动画效果。我想要TextView说姓名、年龄、性别从左侧移动到屏幕上的特定位置。例如:就像TextView从屏幕的左端移动一样。这些字段垂直排列在线性布局上。

4

1 回答 1

0

在 res/anim/ 中创建一个名为 ltor.xml 的新 xml,其中包含内容

<set xmlns:android="http://schemas.android.com/apk/res/android"
         android:shareInterpolator="false">
        <translate android:fromXDelta="-100%" android:toXDelta="0%"
          android:fromYDelta="0%" android:toYDelta="0%"
         android:duration="700"/>
       </set>

在要设置动画的视图中提供以下属性。

android:animation="@anim/ltor"

于 2012-07-17T11:31:17.620 回答