The layout I used for test is:
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:background="#a0ff6600"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <ImageView
- android:src="@drawable/icon"
- android:scaleType="center"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"/>
- <com.android.gltest.GLSurfaceView
- android:id="@+id/surface_view"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"/>
- </RelativeLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
And add codes in test activity (I used activity with translucent theme),
Using java Syntax Highlighting
- ...
- setContentView(R.layout.layout_test_surface_view);
- mGLSurfaceView = (GLSurfaceView) findViewById(R.id.surface_view);
- mGLSurfaceView.setRenderer(new CubeRenderer(true));
- mGLSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
- ...
Parsed in 0.029 seconds, using GeSHi 1.0.8.4
The ImageView cannot be seen. But if I change the order, put the ImageView above the GLSurfaceView, it works fine!
Modified xml is:
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:background="#a0ff6600"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <com.android.gltest.GLSurfaceView
- android:id="@+id/surface_view"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"/>
- <ImageView
- android:src="@drawable/icon"
- android:scaleType="center"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"/>
- </RelativeLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
See the comparison of screenshots is attached below:
So, is this the problem of incorrect using or configuring of GLSurfaceView or just the problem of implement of GLSurface itself?
Looking forward to your helps.



