2

TabHost 바로 아래에 AdView를 가져 오려고합니다. RelativeLayout이 android:layout_alignParentBottom="true" 일이 허용하지만 TabHost 내용을 겹쳐서 ScrollView를 위해 각 Tab 내부에 추가합니다 (높이가 충분히 큰 뷰의 경우 발생합니다)XML의 TabHost 아래에 AdView 추가

바로 지금 얻을 수있는 가장 가까운 것입니다. 화면에 자신의 별도 공간에 TabHost와 AdView를 갖는 것은 (아래)이 코드를 사용하여 직접적으로 위의 위의 광고를 가질 수 있습니다.

<?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:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

    <com.google.ads.AdView 
     android:id="@+id/ad" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     ads:adSize="BANNER" 
     ads:adUnitId="####" 
     ads:loadAdOnCreate="true" 
     ads:testDevices="####" /> 

    <TabHost 
     android:id="@android:id/tabhost" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:orientation="vertical" > 

      <TabWidget 
       android:id="@android:id/tabs" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" /> 

      <FrameLayout 
       android:id="@android:id/tabcontent" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" /> 
     </LinearLayout> 
    </TabHost> 

</LinearLayout> 

답변

4

당신은 이제 탭 호스트가 AdView의 후 남은 공간을 차지합니다

<TabHost 
    android:id="@android:id/tabhost" 
    android:layout_width="fill_parent" 
    android:layout_height="0dip" 
    android:layout_weight="1.0"> 

같은 AdView의 후 나머지 공간을 채우기 위해 탭 호스트를해야한다 .

+0

고맙습니다! 이 작업을 빨리하고 xml 탭 호스트 아래에 adview 넣을 :) – skyllo