如何在Android上调整和移动SDLSurface

如何在Android上调整和移动SDLSurface,android,android-activity,sdl,sdl-2,Android,Android Activity,Sdl,Sdl 2,我正在尝试在Android上使用SDL2构建一个项目 我的项目要求是让屏幕的一半填充SDL表面,另一半填充一些android按钮 我试图编辑标准项目来实现这一点 这是我的布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pare

我正在尝试在Android上使用SDL2构建一个项目

我的项目要求是让屏幕的一半填充SDL表面,另一半填充一些android按钮

我试图编辑标准项目来实现这一点

这是我的布局:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:id="@+id/sdl_view"
    tools:context="org.libsdl.app.SDLActivity">

    <TextView android:text="@string/hello_world" android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true" />

</RelativeLayout>
我的问题是,我有一半的屏幕填充了表面,另一个是白色的。所以,实际上,我在布局中看不到文本视图

我怎样才能解决这个问题

public class SDLActivity extends Activity {
    protected void onCreate(Bundle savedInstanceState) {
        //Log.v("SDL", "onCreate()");
        super.onCreate(savedInstanceState);

        // So we can call stuff from static callbacks
        mSingleton = this;

        // Set up the surface
        mEGLSurface = EGL10.EGL_NO_SURFACE;
        mSurface = new SDLSurface(getApplication());
        mEGLContext = EGL10.EGL_NO_CONTEXT;


        mLayout = (LinearLayout)findViewById(R.id.sdl_view);
        //mLayout = new AbsoluteLayout(this);
        mLayout.addView(mSurface);

        setContentView(mLayout);

        android.view.ViewGroup.LayoutParams lp = mSurface.getLayoutParams();
        lp.height = 300;
        // Commit the layout parameters
        mSurface.setLayoutParams(lp);

    }
...
}