实际上我在屏幕底部的应用程序中显示一个google.ads.AdView ..一切正常.但唯一的问题是它在三星星系音符中显示时并不占据屏幕的整个宽度,但是在nexus中显示它需要屏幕的整个宽度.
为什么会发生这种情况,是否有办法解决这个问题.
我把我的google.ads.AdView放在我的xml布局中
<LinearLayout
android:id="@+id/bottom_control_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="a14e5222d46c63d"
ads:loadAdOnCreate="true" >
</com.google.ads.AdView>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
Raj*_*esh 21
AdView的宽度因adSize属性而异.您可以在https://developers.google.com/mobile-ads-sdk/docs/admob/android/banner#banner_size中查看此属性的各种值.如果您使用的SMART_BANNER
是AbMob的v6.0.0或更高版本,则可以使用该常量.
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="yourAdUnitId"
ads:adSize="SMART_BANNER"
ads:loadAdOnCreate="true"/>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7993 次 |
最近记录: |