我的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>
Run Code Online (Sandbox Code Playgroud)
然后我使用FrameLayout的addView方法添加我的GLSurfaceView.如果我不这样做,抽屉按预期工作.
当我将其滑入时,ListView似乎被正确拉出,因为我无法再与GLSurfaceView交互,直到我向左滑动它.但它根本没有显示,就像GLSurfaceView总是在它上面渲染一样.
如何使用GLSurfaceView作为其内容使用DrawerLayout?
我目前正在尝试为 UTF-8 C 字符串实现自定义封送拆收器。问题是,我正在处理的字符串不一定以 null 结尾,所以我需要依赖它们的常量大小或大小参数。当将它们编组为 LPStr 时,我可以使用 SizeParamIndex 和 SizeConst MarshalAs 属性参数,但我似乎无法访问我的 ICustomMarshaler 实现中的那些参数。
我想避免在每个函数上使用 Byte[] 和手动 UTF-8 转换,但似乎这是唯一的方法?或者我是否缺少某种方式来访问 SizeParamIndex/SizeConst 信息?即使我可以以某种方式在封送拆收器中传递这些数据,我将如何获得 SizeParamIndex 的实际大小值?