0
내 TableLayout에 Admob을 통합하려고합니다. 불행히도 화면에 표시되지 않습니다. 레이아웃에는 상단에 일부 텍스트 필드 만 포함되며 하나의지도 뷰에는 광고 뷰가 하단에 배치되어야합니다. 내 XML 레이아웃은 다음과 같습니다TableLayout/TableRow에 Admob adview를 통합하십시오.
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
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="wrap_content"
android:stretchColumns="1"
android:id="@+id/main">
<TableRow>
<TextView
android:id="@+id/txt1"
android:gravity="center"
android:text="text1"
android:textSize="25sp"
android:layout_span="3"/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/txt2"
android:gravity="center"
android:text="txt2"
android:textSize="25sp"
android:layout_span="3"
/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/txt3"
android:gravity="left"
android:text="txt3"
android:textSize="25sp"
android:paddingLeft="20sp"/>
<TextView
android:id="@+id/txt4"
android:gravity="right"
android:text="txt4"
android:textSize="25sp"
android:paddingRight="20sp"/>
</TableRow>
<TableRow>
<com.google.android.maps.MapView
android:layout_span="2"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:apiKey="XXX"
android:clickable="true"
/>
</TableRow>
<TableRow>
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="XXX"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR, XXX"
ads:loadAdOnCreate="true"
android:layout_span="2"
/>
</TableRow>
</TableLayout>
사람이 내가 제대로 표시된로 AdView를 얻기 위해 변경해야 할 무엇을 말해 줄 수?
수 있습니다 생각하십니까? 아마 상대적 레이아웃과 시도. 다음은 다른 SO 토론의 참조 링크입니다.이 링크는 TableLayout이 아닌 TabHost에 대한 것이지만 개념은 동일합니다. http://stackoverflow.com/questions/3576117/android-tabview-layout-with-admob – kosa
이미 시도했습니다. 그러나 이것도 작동하지 않았다 : ( – nr1
당신은 logcat에서 로그를보고 광고 피드를 수신하고 있는가? 그렇다면 대부분 레이아웃 설정과 함께 hieght 및 너비 등으로 재생한다. – kosa