是否可以在GLSurfaceView上添加LinearLayout?如何在GLSurfaceView上覆盖LinearLayout?也许GLSurfaceView是游戏场,LinearLayout是菜单吧~
发布于 2011-11-23 00:08:06
使用FrameLayout。将GLSurfaceView作为FrameLayout中的第一个视图,然后添加第二个LinearLayout。这将把linearLayout和其中的任何内容放在GLSurfaceView的顶部:
<FrameLayout
android:id="@+id/graphics_frameLayout1"
android:layout_width="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent">
<android.opengl.GLSurfaceView
android:id="@+id/graphics_glsurfaceview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</android.opengl.GLSurfaceView>
<LinearLayout
android:layout_height="fill_parent"
android:id="@+id/linearLayout1"
android:gravity="center"
android:layout_width="fill_parent"
android:orientation="vertical">
</LinearLayout>
</FrameLayout>编辑:现在带图片:

https://stackoverflow.com/questions/8228738
复制相似问题