2010-11-25 66 views
2

我試圖展示Admob廣告,但這隻適用於橫向廣告,但不適用於正常模式。Android XML佈局適用於橫向廣告,但不是正常方向

layout-land/main.xmllayout/main.xml是一樣的! (現在好了,他們是因爲我刪除了其他所有東西以查找bug)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:myapp="http://schemas.android.com/apk/res/test.testpkg" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/background" 
    android:padding = "10dip" > 

     <com.admob.android.ads.AdView 
      android:id="@+id/ad" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      myapp:backgroundColor="#000000" 
      myapp:primaryTextColor="#FFFFFF" 
      myapp:secondaryTextColor="#CCCCCC" /> 

</RelativeLayout> 
+0

什麼問題?意外的行爲,與佈局的問題... – Impression 2010-11-25 22:54:55

+0

也不例外,只是admob ap不是在縱向顯示..只在景觀我可以看到它 – Martin 2010-11-25 22:58:10

回答

3

從相對佈局中刪除填充。填充祖先視圖時,AdMob不會很好地播放。

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:myapp="http://schemas.android.com/apk/res/test.testpkg" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/background" 
    > 


<com.admob.android.ads.AdView 
android:id="@+id/ad" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
myapp:backgroundColor="#000000" 
myapp:primaryTextColor="#FFFFFF" 
myapp:secondaryTextColor="#CCCCCC" 
    /> 
</RelativeLayout> 
相關問題