4

GLSurfaceViewにLinearLayoutを追加することは可能ですか?GLSurfaceViewにLinearLayoutをオーバーレイする方法は?多分GLSurfaceViewはゲームの遊び場であり、LinearLayoutはメニューバーです〜

4

1 に答える 1

12

FrameLayoutを使用します。GLSurfaceViewをFrameLayoutの最初のビューとして使用し、次にLinearLayoutを2番目に追加します。これにより、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>

編集:今写真付き:

ゲーム用のAndroidフレームレイアウト。 mamsペイントスキルをチェックしてください

于 2011-11-22T16:08:05.820 に答える