Android - 如何在SurfaceView上绘制图形

时间:2012-01-20 03:03:54

标签: android android-layout opengl-es

Draw something on top surface view

如上图所示。 我想要做的是如上所示(在红色框内)。 我该怎么办?

1 个答案:

答案 0 :(得分:0)

您可以将SurfaceView添加到RelativeLayout,在xml中创建红色框,并将其放在RelativeLayout中,与SurfaceView重叠!

或者您可以在Canvas绘图方法canvas.drawText中使用值,canvas.drawRect用于白色矩形,canvas.drawPoints用于其余值。

您可以在canvas reference页面阅读更多内容。