0

Admobのコードを書きました。これは私のlayout.xmlファイルコードです:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:id="@+id/relativeLayoutHomeParent"
tools:context=".Home" xmlns:app="http://schemas.android.com/apk/lib/com.google.ads">

<RelativeLayout
    android:id="@+id/relativeLayoutHomeTopBar"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true" >

    <TextView
        android:id="@+id/textView1"
        android:text="Home"
        style="@style/screen_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <ImageView
        android:id="@+id/imageViewHomeSettings"
        android:layout_width="22dp"
        android:layout_height="22dp"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:src="@drawable/set_settings"
        android:layout_marginRight="10dp" />

</RelativeLayout>

<View
    android:id="@+id/view1"
    android:layout_width="match_parent"
    android:layout_height="5dp"
    android:layout_below="@+id/relativeLayoutHomeTopBar"
    android:background="@drawable/shadow" />

<ListView
    android:id="@+id/listViewHome"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:divider="#BDBDBD"
    android:dividerHeight="1dp"
    android:layout_below="@+id/view1" >
</ListView>

<com.google.ads.AdView
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    app:adSize="BANNER"
    app:adUnitId="a1512f50d8c3692"
    app:loadAdOnCreate="true"
    app:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" >
</com.google.ads.AdView>

出力:

スクリーンショット

画面の下部にある上部(はい、その黒いバー)にあるバーが必要です。私も書いたのですが、上の画像のように出力が表示されました。

また、AdMobバナー、一番上のバナー、一番下のバナーのどちらであるかわかりませんか?誰かがこれらの2つのバーの違いを説明できますか?実際、私はこれに不慣れです。admobのコードを作成するのはこれが初めてです。これについて学ぶのを手伝ってください。

4

1 に答える 1