【问题标题】:Admob Ad Overlapping SurfaceViewAdmob 广告重叠 SurfaceView
【发布时间】:2011-06-11 17:52:18
【问题描述】:

我在 android manifest 中使用了以下内容。

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.ads.AdView 
    android:id="@+id/adView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    ads:adUnitId="@string/admob_id"
    ads:adSize="BANNER"
    ads:loadAdOnCreate="true"
    android:background="#FF0000"
    />
<com.Joey_Ant.Lite.GameView
    android:id="@+id/gameScreen"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_above="@id/adView"
    />
</RelativeLayout>

但是,广告仍然与表面视图重叠 (com.Joey_Ant.Lite.GameView)。

如何在广告加载时调整屏幕?

【问题讨论】:

    标签: android admob surfaceview overlap


    【解决方案1】:

    你可以试试这个,它不会与surfaceview重叠,但即使广告没有加载它也会离开广告空间

       <LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
    <com.Joey_Ant.Lite.GameView
        android:id="@+id/gameScreen"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        />
    <com.google.ads.AdView 
        android:id="@+id/adView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        ads:adUnitId="@string/admob_id"
        ads:adSize="BANNER"
        ads:loadAdOnCreate="true"
        android:background="#FF0000"
        />
    
    </LinearLayout>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-09
      相关资源
      最近更新 更多