Admob advertisement (Android) is to small

只谈情不闲聊 提交于 2019-12-11 20:26:28

问题


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.



来源:https://stackoverflow.com/questions/5921132/admob-advertisement-android-is-to-small

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!