Admob advertisement (Android) is to small

2019-09-03 21:35发布

问题:

I placed a admob advertisement in my Android App (Block Crusher) and on QVGA the advertisment is smaller then the screen. On bigger resolutions there is no problem.

I used the following xml to add the admob advertisement to the relative layout:

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

The width of my view is set to fill_parent and when I watch the hierarchy viewer I see that the view is the full width. Still the advertisment is shown as above.

I have this problem both in the emulator as on a QVGA phone.

Anybody else has this problem? And know how to resolve this?

回答1:

If you wrap it in a LinearLayout, then assign it a weight, and/or assign height=50dip you should fill the area.

Banner's base are 320x50.



回答2:

The problem was fixed when I updated the Admob SDK to version 4.1.0.