use*_*429 6 android android-animation android-layout android-gridview
我有两个网格视图,我想为其创建自定义动画.想象一下这个布局:
___________________________________________ | | | | | TOP Grid | | | |_________________________________________| | | | | | BOTTOM | | Grid | | | |_________________________________________|
底部网格将在顶部网格后面"滑出"和"滑动".我想我应该使用翻译动画.如何找出fromX和fromY值?我以为我可以同时在布局中查看,然后将动画设置为RelativeToParent.
这是正确的方法吗?如果您知道任何地方我可以找到此功能的源代码,我将非常感激.谢谢,
试试这个slide-out和slide-in动画。
slide-top-in.xml
Run Code Online (Sandbox Code Playgroud)<set xmlns:android="http://schemas.android.com/apk/res/android"> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fromYDelta="0" android:toYDelta="-100%p" android:duration="1000" /> </set>
slide-top-out.xml
Run Code Online (Sandbox Code Playgroud)<translate xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fromYDelta="-100%p" android:toYDelta="0" android:duration="1000" />
| 归档时间: |
|
| 查看次数: |
966 次 |
| 最近记录: |