简体   繁体   English

android从右到左动画

[英]android animate right to left

I am applying animation on popup, right to left. 我正在从右到左在弹出窗口上应用动画。 I am using this piece of code, but even after some experiments, it always scale from left to right 我正在使用这段代码,但是即使经过一些实验,它也总是从左到右缩放

<set xmlns:android="http://schemas.android.com/apk/res/android"> 
<scale
android:fromYScale="0"
android:toYScale="1"
android:startOffset="0"
android:duration="300"

android:fromXScale="0.5"
android:toXScale="1"
android:fillBefore="true" />

I have tried setting pivotX to 1 but still the result is always same. 我尝试将pivotX设置为1,但结果始终相同。

Have you tried to use translate instead of scale (or both) ? 您是否尝试过使用translate而不是scale (或同时使用两者)?

<translate
    android:fromXDelta="0"
    android:toXDelta="100%p"
    android:fromYDelta="100%p"
    android:toYDelta="100%p" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM