运用动画,同时改变视图的可视性 [英] Applying animations while changing visibility of a view
问题描述
我有我的应用程序中的HorizontalScrollView,我与它的知名度非常频繁打(可见光和消失)。所以,我要的是,而不是突然使其可见和不可见的,我可以申请某种形式的动画或什么的,这样它会开始成为一个滑动的方式有形和无形的?
I am having a HorizontalScrollView in my application and I am playing with its visibility very frequently(VISIBLE and GONE). So what I want is, instead of suddenly making it visible and invisible, can I apply some kind of animation or something so that it will start becoming visible and invisible in a sliding manner ?
任何帮助或建议将是非常美联社preciated。
提前致谢。
Any help or suggestions would be highly appreciated. Thanks in advance.
推荐答案
您可以试试这个:
Animation animation = new TranslateAnimation(0,0,0,1000);
animation.setDuration(1000);
yourButtonorImage.startAnimation(animation);
要使其可见或不可见,你可以使用setAnimationListener。在onAnimationEnd,使其可见或不可见。不知道这是你meant..Hope什么帮助。
To make it visible or invisible you could use setAnimationListener. In onAnimationEnd, make it visible or invisible. NOt sure if this is what you meant..Hope it helps..
这篇关于运用动画,同时改变视图的可视性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!