当我将背景设置为我的表面视图时,我看到了我设置为背景的内容。但是,当我锁定/解锁表面视图的画布时,我无法绘制简单的东西,例如圆圈。我看到的只是背景图像。
有什么我想念的吗?
有什么想法吗?
当我将背景设置为我的表面视图时,我看到了我设置为背景的内容。但是,当我锁定/解锁表面视图的画布时,我无法绘制简单的东西,例如圆圈。我看到的只是背景图像。
有什么我想念的吗?
有什么想法吗?
你错过了谷歌。
http://android-er.blogspot.com/2010/05/android-surfaceview.html
http://www.droidnova.com/playing-with-graphics-in-android-part-v,188.html
解决方案非常简单。
//get surface view and surface holder
mySurfaceView = (SurfaceView) findViewById(R.id.surfaceView);
surfaceHolder = mySurfaceView.getHolder();
//place surface view holder on top of the surface view
mySurfaceView.setZOrderOnTop(true);
//set pixels of the surface holder to transparent to see the color of the
//surface view background
surfaceHolder.setFormat(PixelFormat.TRANSPARENT);