在动画中使用渐变为一个视图视图、画中

2023-09-04 22:59:37 作者:很酷很霸气

我想有一个查看最初是不可见的,当我preSS一个按钮,就变得可见,在动画褪色。我使用了 AlphaAnimation 的褪色效果。问题是,如果我做的观点看不到动画都看不出来。

I want to have a View that initially is invisible and when I press a button, it becomes visible with a fade in animation. I'm using the AlphaAnimation for the fading effect. The problem is that if I make the view invisible the animation can't be seen.

感谢了很多,

的Gratzi

推荐答案

提供一个 AnimationListener 的动画,使视图可见只要动画开始。

Provide an AnimationListener to the Animation and make the View visible as soon as the Animation starts.

http://developer.android.com/reference/android/view/animation/Animation.AnimationListener.html