Admob advertisement (Android) is to small

2019-09-03 22:15发布

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.

Admob advertisment to small

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?

2条回答
Deceive 欺骗
2楼-- · 2019-09-03 22:16

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

查看更多
冷血范
3楼-- · 2019-09-03 22:26

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.

查看更多
登录 后发表回答