伙计们,我制作了一个自定义列表视图,列表视图有三个文本字段。我希望以下事情起作用,当用户从他刚刚填充文本视图的活动中按下后退按钮时,他会返回到包含自定义列表视图的活动。刚刚创建的最近条目已经存在于那里。每次用户进入列表视图活动时,我希望条目从右侧滑入。这是列表视图 xml 的代码:
<LinearLayout
android:id="@+id/listHolder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#ffffff" >
<ListView
android:id="@+id/mylist"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
这里的列表视图实际上并没有利用完整的空间,因为 100dp 的屏幕尺寸被其他一些小部件占用(但这在这里并不重要)。我正在使用的动画是这样的:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >
<scale
android:duration="1500"
android:fillAfter="false"
android:fromXScale="480dp"
android:fromYScale="0dp"
android:interpolator="@android:anim/overshoot_interpolator"
android:pivotX="60"
android:pivotY="10"
android:toXScale="100dp"
android:toYScale="0dp" />
</set>
动画 xml 有什么问题?我是否为 x 和 y 值设置了错误的参数?我得到的是列表视图在用户进入该活动一秒钟或更晚之后出现。我的意思是没有从右到左的过渡。知道为什么会这样。谢谢。