【问题标题】:Android XML-animations "bind" pivot to a special pointAndroid XML 动画“绑定”枢轴到一个特殊点
【发布时间】:2015-07-27 20:33:25
【问题描述】:

我正在编写一个 Android 应用程序,并且我想使用最新的 Android 材料指南。所以我在anim.xml 中有一个AlertDialog 和我自己的动画。这是我对对话框的动画:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <scale android:interpolator="@android:anim/accelerate_decelerate_interpolator"
       android:fromXScale="0.0"
       android:toXScale="1.0"
       android:fromYScale="0.0"
       android:toYScale="1.0"
       android:fillAfter="false"
       android:startOffset="0"
       android:duration="200"
       android:pivotX="90%"
       android:pivotY="85%"/>

    <translate android:fromYDelta="50%"
           android:toYDelta="0"
           android:startOffset="0"
           android:duration="200"/>
</set>

这适用于应用的纵向模式。但是如果我切换到横向模式,动画就不能正常工作了。

但是,例如,我想要的是 FloatingButton 的原点,而不是 android:pivotX="90%"

是否有可能将此点“绑定”到此 XML 标记。 我没有发现任何有用的东西。

谢谢,

HumpaLumpa007

【问题讨论】:

    标签: android xml animation android-alertdialog


    【解决方案1】:

    很难想象您要完成什么,但您可能会发现ScaleAnimation 很有帮助。我希望这有帮助。

    【讨论】:

    • 似乎这只是我的 XML 的硬编码版本,但也许有帮助。我要尽快试试。谢谢
    猜你喜欢
    • 2018-03-05
    • 2013-06-06
    • 2018-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-22
    相关资源
    最近更新 更多