首页 > 解决方案 > How to translate animation from top?

问题描述

I try to animate move item from to to it current position in xml

I try this

 <?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"

    android:duration="@android:integer/config_longAnimTime"
    android:fromYDelta="0%p"
    android:toYDelta="0"
    />

But faile. I do not understant fully how to coerce this Android to make this. Need you help please.

标签: androidxmlanimationtranslate

解决方案


我想我建立了解决方案

-100%p 而不是 0%p

 <?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="@android:integer/config_longAnimTime"
    android:fromYDelta="-100%p"
    android:toYDelta="0"
    />

推荐阅读