SurfaceView shows black screen - Android

后端 未结 5 1614
情话喂你
情话喂你 2020-12-19 04:55

Basically I want to use SurfaceView for animation. Therefore the class implements Runnable. To experiment, I want to draw a circle. However, it shows only a black screen.

5条回答
  •  一生所求
    2020-12-19 05:10

    At your DrawStripFrame constructor set alpha to zero. Like this:

    public DrawStripFrame (Context context){
        super (context);
        holder = getHolder();
    
        setAlpha(0); // this is the secret
    }
    

提交回复
热议问题