【发布时间】:2011-11-22 14:50:15
【问题描述】:
是否可以在 GLSurfaceView 上添加 LinearLayout? 如何在 GLSurfaceView 上覆盖 LinearLayout? 或许 GLSurfaceView 是 Game playground 而 LinearLayout 是 menubar~
【问题讨论】:
标签: android opengl-es glsurfaceview
是否可以在 GLSurfaceView 上添加 LinearLayout? 如何在 GLSurfaceView 上覆盖 LinearLayout? 或许 GLSurfaceView 是 Game playground 而 LinearLayout 是 menubar~
【问题讨论】:
标签: android opengl-es glsurfaceview
使用框架布局。将 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>
编辑:现在有图片:
【讨论】: