您可以在代码或XML布局中将元素叠加在SurfaceView之上.

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical"

>

android:id="@+id/mysurface"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

>

在您的活动中:

TextView myText = new TextView(this);

myText.setText("Something");

addContentView(myText, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

但是不知道性能问题.

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐