raiderJerry
Lurker
Hi all,
I am trying to display a GLSurfaceView at the top of the screen with a separate layout containing buttons at the bottom. Seems simple enough, in fact I can get it to work with the button layout at the top and the GLSurfaceView layout at the bottom. But when I put the GLSurfaceView at the top, the button layout just doesn't show up.
Here is my main.xml
Here is my activity code
Like I said, it draw the surfaceView just fine, but no buttons at the bottom.
Thanks in advance
raiderJerry
I am trying to display a GLSurfaceView at the top of the screen with a separate layout containing buttons at the bottom. Seems simple enough, in fact I can get it to work with the button layout at the top and the GLSurfaceView layout at the bottom. But when I put the GLSurfaceView at the top, the button layout just doesn't show up.
Here is my main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- View Container -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_gravity="top" >
<android.opengl.GLSurfaceView android:id="@+id/glSurface"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<!-- Controls Container -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="bottom">
<Button android:id="@+id/leftSignalButton" android:text="@+string/leftSignalButtonLabel"
android:onClick="clickHandler" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:gravity="center" android:layout_gravity="left"/>
<Button android:id="@+id/rightSignalButton" android:text="@+string/rightSignalButtonLabel"
android:onClick="clickHandler" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:gravity="center" android:layout_gravity="right"/>
</LinearLayout>
</LinearLayout>
Code:
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
this.surfaceView = (GLSurfaceView) this.findViewById(R.id.glSurface);
if (this.surfaceView != null)
{
this.surfaceView.setRenderer(new DrawSomethingRenderer(this));
this.surfaceView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
}
}
Thanks in advance
raiderJerry