如何将libgdx呈现对象添加到当前layout.xml视图中

时间:2012-04-06 11:32:28

标签: android

如何将libgdx渲染视图添加到当前的android xml布局

例如

的LinearLayout>

        <com.libgdxView.obj
            android:id="@+id/sheet"
            android:layout_width="1152dp"
            android:layout_height="576dp"
            android:layout_centerInParent="true" 
            />

/的LinearLayout&GT;

感谢。

2 个答案:

答案 0 :(得分:0)

<com.libgdxView.obj.**YourClassName**
        android:id="@+id/sheet"
        android:layout_width="1152dp"
        android:layout_height="576dp"
        android:layout_centerInParent="true" 
        />

试试这个

答案 1 :(得分:0)

终于得到了解决方案......

//创建布局         RelativeLayout layout = new RelativeLayout(this);

    // Do the stuff that initialize() would do for you
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

    // Create the libgdx View
    View gameView = initializeForView(new YouSpinMeRound(), false);
    // Add the libgdx view
    layout.addView(gameView);