我们需要您的代码(总体而言,将链接指向您所基于的内容并不是很有帮助)
我的方法是在布局中定义所有这些
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:gravity="center"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:gravity="center_horizontal"
android:orientation="horizontal"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</LinearLayout>
<android.pixelrain.opengl.GLSurfaceViewChipmunk android:id="@+id/composed"
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<LinearLayout
android:id="@+id/linearLayoutAd"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true"
android:orientation="vertical"
android:gravity="center_horizontal"
/>
</RelativeLayout>
注意 GLSurfaceViewChipmunk 是你用 cocos2d 替换的。
然后在应用程序中
private void InitAdView()
{
LinearLayout layout = (LinearLayout)findViewById(R.id.linearLayoutAd);
// Create the adView
adView = new AdView(this, AdSize.BANNER, AppSettings.AdmobAppId);
...set your add listener
// Add the adView to the layout
layout.addView(adView);