gpt4 book ai didi

Android:如何显示透明BG的动画?

转载 作者:太空狗 更新时间:2023-10-29 13:25:24 25 4
gpt4 key购买 nike

我想在透明 Activity 上显示具有透明背景的动画。我怎样才能用Android实现它?我想到了 flash,但用户必须安装 flash,对吗?我更喜欢矢量图而不是 gif。

提前致谢!

例子:

enter image description here

最佳答案

显示动画的最佳方式是将它们存储为 PNG 并为动画做这样的事情,将其放入您的可绘制文件夹中。:

<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> 
<item android:drawable="@drawable/ant1" android:duration="100" />
<item android:drawable="@drawable/ant2" android:duration="100" />
<item android:drawable="@drawable/ant3" android:duration="100" />
<item android:drawable="@drawable/ant2" android:duration="100" />
</animation-list>

如果要使用矢量图形,则必须手动切换图像。你可以看看 svg-android ,这是在 Android 中使用简单矢量图像的好方法。

关于Android:如何显示透明BG的动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21829572/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com