有没有办法将 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/