2011-09-11 40 views
0

我在做一個應用程序與此main.xml中佈局:如何把正確的AdMob位置的Android

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
android:orientation="vertical" android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 
<TabHost android:id="@+id/tabhost" android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <LinearLayout android:id="@+id/linearLayout1" 
     android:layout_width="fill_parent" android:layout_height="fill_parent" 
     android:orientation="vertical"> 
     <TabWidget android:layout_width="fill_parent" 
      android:layout_height="wrap_content" android:id="@android:id/tabs"></TabWidget> 
     <FrameLayout android:layout_width="fill_parent" 
      android:layout_height="fill_parent" android:id="@android:id/tabcontent"> 
      <LinearLayout android:layout_width="fill_parent" 
       android:layout_height="fill_parent" android:background="#013364" 
       android:id="@+id/tab1"> 


       <ListView android:layout_height="wrap_content" 
        android:layout_width="fill_parent" android:id="@+id/listView2" 
        android:background="#efefef" android:cacheColorHint="#00000000"></ListView> 
      </LinearLayout> 

      <LinearLayout android:layout_width="fill_parent" 
       android:layout_height="fill_parent" android:background="#013364" 
       android:id="@+id/tab2"> 
       <ListView android:layout_height="wrap_content" 
        android:layout_width="fill_parent" android:id="@+id/listView1" 
        android:background="#efefef" android:cacheColorHint="#00000000"></ListView> 
      </LinearLayout> 
      <LinearLayout android:layout_width="fill_parent" 
       android:layout_height="fill_parent" android:id="@+id/tab3"> 
       <WebView android:layout_width="fill_parent" 
        android:layout_height="fill_parent" android:id="@+id/webview" /> 
      </LinearLayout> 
      <LinearLayout android:layout_width="fill_parent" 
       android:layout_height="fill_parent" android:background="#013364" 
       android:id="@+id/tab4"> 
       <ListView android:layout_height="wrap_content" 
        android:layout_width="fill_parent" android:id="@+id/listView3" 
        android:background="#efefef" android:cacheColorHint="#00000000"></ListView> 
      </LinearLayout> 


     </FrameLayout> 
    </LinearLayout> 
</TabHost> 

所以你可以看到,我有4個選項卡區,我想把我的廣告在我的形象的黃色區域中的所有選項卡:

enter image description here

我怎麼會做這種事。

在此先感謝。

回答

0

這就是我想要的東西:

<FrameLayout android:layout_width="fill_parent" 
      android:layout_height="fill_parent" android:background="#013364" 
      android:id="@+id/tab1"> 
       <ListView android:id="@+id/android:list" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" android:background="#efefef" android:cacheColorHint="#00000000" android:layout_marginBottom="50dip"/> 
//CODE OF ADS </FrameLayout>