【发布时间】:2014-07-04 15:42:49
【问题描述】:
我的 Android 应用是全屏 OpenGL ES 2.0 应用,因此主要内容是 GLSurfaceView 的自定义扩展。 活动布局如下所示:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/drawer_layout">
<FrameLayout android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111" />
</android.support.v4.widget.DrawerLayout>
然后我使用 FrameLayout 的 addView 方法添加我的 GLSurfaceView。 如果我不这样做,抽屉将按预期工作。
当我滑入 ListView 时,它似乎被正确拉出,因为我无法再与 GLSurfaceView 交互,直到我将它滑回左侧。但它根本不显示,就像 GLSurfaceView 总是呈现在它上面。
如何让 DrawerLayout 使用 GLSurfaceView 作为其内容?
【问题讨论】:
标签: java android listview opengl-es