简体   繁体   English

Android上的Alpha淡出方向

[英]Alpha fade direction on Android

Is it possible to change the alpha value of an ImageView along a specific direction ie from top to bottom or bottom to top on Android? 是否可以在Android上沿特定方向更改ImageView的alpha值,即从上到下或从下到上?

I am trying to animate with imageView.animate().alpha(0).setDuration(500).start(); 我正在尝试使用imageView.animate().alpha(0).setDuration(500).start();进行动画处理imageView.animate().alpha(0).setDuration(500).start(); however this just fades the entire view out uniformly, but I'd like to do this form top to bottom instead. 然而,这只会使整个视图均匀地消失,但我想从上到下做这种形式。

Any help appreciated. 任何帮助赞赏。

As far as I know, it is not (yet) possible with the Android built in animations. 据我所知,Android内置的动画可能还没有。 You will have to create your own custom animation. 您必须创建自己的自定义动画。 Haven't tried, but maybe you can achieve this by using the Transformation class, and/or overriding the onApplyTransformation method from the AlphaAnimation class 还没试过,但也许你可以通过使用Transformation类来实现这一点,和/或覆盖AlphaAnimation类中的onApplyTransformation方法

method. 方法。

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

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