【问题标题】:How animate margin in UWP?如何在 UWP 中设置边距?
【发布时间】:2019-09-08 23:09:43
【问题描述】:

我正在尝试使用

    <animations:AnimationCollection x:Name="UnHoverCollection">
      <animations:Vector2Animation To="10,10" Target="Margin" />
    </animations:AnimationCollection>

还有这个动画

    <animations:AnimationCollection x:Name="UnHoverCollection">
      <animations:Vector4Animation To="10,10,10,10" Target="Margin" />
    </animations:AnimationCollection>

并采取下一个错误

"未找到指定的属性或无法设置动画。上下文: 边距表达式:边距开始位置:0,结束位置:6"

这个动画是怎么做的?

【问题讨论】:

标签: xaml animation uwp uwp-xaml windows-community-toolkit


【解决方案1】:

如果你想移动对象,动画边距不是一个好主意。这些动画类型主要是根据X、Y坐标来操作的。我建议你可以使用 TranslationAnimation 或 OffsetAnimations。你可以参考这个document来移动对象。

【讨论】:

    猜你喜欢
    • 2011-05-19
    • 2022-10-21
    • 2012-09-16
    • 2017-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-21
    相关资源
    最近更新 更多