java - 在 GLSurfaceView 上设置 AlphaAnimation

标签 java android alpha surfaceview glsurfaceview

有没有办法将 GLSurfaceView 上的动画设置为从完全不透明淡入 0 alpha 透明度?我有以下不执行任何操作的代码:

AlphaAnimation anim = new AlphaAnimation(1f, 0f);
anim.setDuration (5000);
anim.setFillAfter(true);
glSurfaceView.startAnimation(anim);

我知道 SurfaceView 通常不像普通的 View 对象那样工作,所以这是解决这个问题的正确方法吗?还有其他更好的方法吗?有可能吗?

最佳答案

我知道这是一个旧线程,但可以通过在其顶部放置带有黑色背景的空白 View 来淡入/淡出 SurfaceView。然后,您只需在此 View 上应用 AlphaAnimation。

关于java - 在 GLSurfaceView 上设置 AlphaAnimation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5511401/

相关文章:

android - 如何在使用 android :background ="@drawable/view1" 时滚动列表

Android:为什么在 Activity onCreate 上将静态变量设置为 null

html - shape-outside 不响应 alpha channel

java - 堆积条形图 : Changing the order of the stacked columns for just one of the bars

android - 如何在 flutter 项目上手动运行 gradle build

java - 如何检查文件是否被另一个进程(Java/Linux)打开?

c++ - OpenGL 混合在纹理周围创建白色边框

r - 展平 ggplot2 中的 alpha channel

java - 打印AVL树: Java

java - 我可以在 ANT 中使用 less4j 将 less 编译成 css 吗?