내 tabhost
의 모든 탭에 Google 광고 adview
을 얻으려고 시도 중이지만 작동하지 않습니다. main.xml
에 adview를 배치하면 모든 탭에서 adview를 볼 수 있습니다. 하지만 문제는보기 (버튼)가 광고 뷰 위에 표시되어 더 이상 광고를 볼 수 없다는 것입니다.모든 탭 (탭 호스트, admob)에 adview
는 main.xml에 :
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<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" >
<include layout="@layout/tab1" />
<include layout="@layout/tab2" />
<include layout="@layout/tab3" />
<include layout="@layout/tab4" />
</FrameLayout>
</LinearLayout>
</TabHost>
</TableLayout>
</LinearLayout>
tab1.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res/com.this.app"
android:id="@+id/tab1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="xxx" />
<ScrollView
android:id="@+id/scrollview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/adView" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TableRow>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2" />
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
는 (화면 하단) –
@Shahzad 탭 아래 광고의 위치를 지정 아래 또는 tabs.Please 위의 광고를보고 싶어요. – Bldjef