私はAndroidプロジェクトに取り組んでおり、AdMobsDKの最新バージョンをダウンロードしました。
画面の下部に広告を配置しようとしていますが、何も機能しないようです。
以下はレイアウトのXMLコードです
<?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="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView android:id="@+id/password_noRecords"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
android:text="There are currently\nno saved logins"
android:textSize="20dp"
android:textStyle="bold|italic"/>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</ListView>
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adUnitId="MY_ID"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR, emulator-5554"
ads:loadAdOnCreate="true">
</com.google.ads.AdView>
</LinearLayout>
高さでListViewとLinearLayoutfill_parentを作成しようとしましたが、logcatには、広告を表示するのに十分なスペースがないと表示されます。
また、広告を線形レイアウトでラップして、親の下部を揃える= trueと言ってみましたが、違いはありません。
代わりに、広告はリストビューの下部に直接配置されるため、リストビューが半分空の場合、広告は画面の中央に表示されます。
私が欲しいのは、リストビューがどんなに大きくても小さくても、画面の下部に常に表示される広告です。
あなたが提供できるどんな助けにも感謝します。