简体   繁体   English

安卓中的幻灯片

[英]Slideshow in android

I am seeking some pointers on how to create a sideshow application in Android.我正在寻找一些关于如何在 Android 中创建杂项应用程序的指示。 I need to have the Android transition animation when I switch between the images.当我在图像之间切换时,我需要有 Android 过渡动画。

You can fade the images in and out (or probably use other transitions) using the Animation classes in Android.您可以使用 Android 中的动画类淡入和淡出图像(或可能使用其他转换)。 Here is something which I use这是我使用的东西

Animation animation = new AlphaAnimation(1.0f, 0.0f);
animation.setDuration(100);
animation.setRepeatCount(0);
animation.setFillAfter(true); 
myView.startAnimation(animation)

Then load the other image when this completes.然后在完成后加载另一个图像。 You can use an AnimationListener to detect the animation end.您可以使用AnimationListener来检测动画结束。

After the animation do the same thing but reverse the alpha values in AlphaAnimation.在动画之后做同样的事情,但在 AlphaAnimation 中反转 alpha 值。

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

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