如何增加libgdx渲染对象插入到当前layout.xml视图

问题描述:

如何增加libgdx呈现的视图到当前机器人XML布局如何增加libgdx渲染对象插入到当前layout.xml视图

例如

的LinearLayout>

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

/的LinearLayout>

感谢。

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

试试这个

+0

什么问题ü面对? – MAC 2012-04-07 09:06:52

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

//创建布局 RelativeLayout的布局=新的RelativeLayout(本);

// 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);