首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安卓GLSurfaceView

安卓GLSurfaceView
EN

Stack Overflow用户
提问于 2011-11-22 22:50:16
回答 1查看 3.1K关注 0票数 4

是否可以在GLSurfaceView上添加LinearLayout?如何在GLSurfaceView上覆盖LinearLayout?也许GLSurfaceView是游戏场,LinearLayout是菜单吧~

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-23 00:08:06

使用FrameLayout。将GLSurfaceView作为FrameLayout中的第一个视图,然后添加第二个LinearLayout。这将把linearLayout和其中的任何内容放在GLSurfaceView的顶部:

代码语言:javascript
复制
<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>

编辑:现在带图片:

票数 12
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8228738

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档